# Corner Detection of Ceramic Crack Computer VR Image Based on Three-Dimensional Reconstruction Algorithm

Authors: Yuyang He
Journal: Security and Communication Networks
 (2022)

---

## Abstract

In order to improve the analysis ability of three-dimensional reconstruction of ceramic crack computer VR image corners, a ceramic crack computer VR image corner detection based on three-dimensional reconstruction algorithm is proposed. Taking the celadon tea cup with cracked glaze as the research object, multiple-side images of porcelain were extracted. Harris corner detection, image registration, and stitching are used to splice the multiple-side image into a complete unfolded image. In order to determine the generalization ability of the algorithm, 10 cracked porcelain cups with the same type but different glaze color are used for image acquisition and stitching, and the effect of the stitching method proposed in this paper is evaluated. The experimental results show that the image mosaic accuracy is more than 92%, which has high accuracy and effectiveness. Through image graying, binarization and morphological thinning, the crack is displayed in three dimensions, which can provide support for subsequent crack morphological display and topology analysis. The processing flow of this paper improves the automation of image stitching of cracked porcelain, and provides support for image stitching, texture detection, and three-dimensional crack analysis of cracked porcelain and other split porcelain. It has strong innovation and practicability.


---

## Body

## 1. Introduction

As one of the three pillars of modern materials, ceramic materials are widely used in modern industry because of their special physical and chemical properties [1]. Ceramic materials, including silicon nitride, silicon carbide, alumina, and germanium oxide, have excellent properties, such as high-temperature resistance, corrosion resistance, wear resistance, and low specific gravity. They are used to make various parts to replace traditional materials in gas turbines, automobiles, internal combustion engines, heat exchangers, various working machinery, precision machinery, and tools. They have a very broad application prospect. However, the fracture toughness of ceramics is generally very low, which is a typical brittle material. Even small defects are easy to cause stress concentration and failure, especially on the outer surface [2]. If nondestructive evaluation method can be used to give full play to the potential of materials, or nondestructive testing method can be used to eliminate waste products in the early stage of ceramic manufacturing, so as to avoid the loss caused by worthless processing. In this way, the economic loss will be recovered, the component failure will be avoided, the product life will be improved, and the material development and manufacturing cycle will be shortened. The development of ceramic nondestructive testing technology has become a major topic in advanced countries [3].The glaze of cracked porcelain is full of small cracks, with irregular lines and massive distribution, forming a unique style of decoration. The generation of cracked glaze and kiln changed flower glaze is accidental. The glaze crack was originally a defect of fired porcelain, but the craftsman summarized the law and experience, adjusted the expansion coefficient of glaze and blank, and made the cracked glaze with clear grain and aesthetic feeling of living alone. Cracks are generally divided into two types: glaze filling type and covering type. The former is to fill the cracks of the fired glaze with soot, ink, and other substances to make the lines appear brown, brown, black, and other colors. The latter is to apply the bottom color glaze to the product first, and then cover the color glaze on it after firing. After calcination, the cover color glaze shows cracks and reveals the color of the bottom glaze [4]. Image processing technology can realize rapid and nondestructive ceramic inspection and analysis and reduce the labor intensity. With the development of computer technology, it is gradually applied to the digital detection and analysis of ceramic shape and decoration. The image processing method is used to analyze the color and texture features of ceramic images, which helps to realize the porcelain slice classification, glaze color analysis, glaze recognition, bubble analysis, and ancient porcelain identification of ancient ceramics, improves the accuracy of detection and classification, and makes up for the shortcomings of traditional detection methods [5, 6]. However, there are few experimental studies on ceramic opening based on color and texture information. Combined with porcelain ware type, image acquisition and processing can be used to obtain the plane expansion map, which can be better used for the analysis and identification of external features such as decoration. Figure 1 is the structural diagram of the crack detection system of ceramic bottle.Figure 1
Structural diagram of ceramic bottle crack detection system.


## 2. Literature Review

In the production process of ceramic components, due to the influence of production environment, production process and other conditions, there may be components with cracks or defects in the obtained products. If these unqualified products cannot be detected and eliminated in time, in the subsequent use process, due to uneven heating, it is likely to cause serious safety accidents, resulting in great harm. Therefore, the appearance integrity detection of ceramic-like element surface is very important. In recent years, with the gradual application of VR image processing technology to industrial detection, the methods of crack detection are also gradually increasing. At first, the method of segmentation of crack region based on gray intensity threshold was widely used [7]. Alessandretti et al. used the iterative tensor voting algorithm for crack extraction, enhanced the significance map of the crack through multiple iterative cycles of the voting process, so as to retain more crack details and improve the accuracy of crack extraction. However, due to its multiple iterative voting, the calculation cost is high, and only the crack curve is obtained, and the crack region is not obtained. Therefore, the algorithm still needs to be further optimized [8]. Jurgen et al. proposed the fragment section extraction and fragment splicing and reorganization method based on local geometric feature learning. This learning based framework is superior to the commonly used classical methods in extracting the key geometric data of vessel fragments [9]. Chen et al. used the methods of edge detection and image enhancement to process the decoration of ceramic tiles, which was realized by MATLAB software programming. It has the advantages of high speed and high precision [10]. Liu et al. processed the inner wall image of ceramic bottle by illumination and denoising, improved the contrast of the inner wall image by image enhancement, and detected the crack through image segmentation and connected domain algorithm, which can accurately detect the strip, transverse, and longitudinal inner wall cracks [11]. Wei et al. built a simulation system for detecting cracks in ceramic bottles through image processing technology and MATLAB software to quickly and accurately detect inner wall defects of ceramic bottles [12]. Kumar et al. used tensor voting algorithm to enhance the crack region and then used the minimum spanning tree algorithm to extract the crack in the constructed graph-based search space. However, due to the imperfection of the connection algorithm, the obtained crack is not complete [13]. Lian et al. preprocessed the red channel image of ceramic tile, then reconstructed the ceramic tile image by principal component analysis, interpolated the two, and finally extracted the crack parameters through binarization and morphological processing to detect the cracks of ceramic tile with complex background interference [14]. Bradha et al. used mixed filtering in spatial domain and wavelet domain to denoise the image of ceramic products, extracted the microdefect crack region, described the log gradient weighted Haar-like feature of the model, trained the crack detection classifier, and realized the nondestructive detection of microdefect crack targets [15].Taking the celadon tea cup with cracked glaze as the research object, this paper extracts multiple-side images of porcelain. Harris corner detection method is used to extract the corners in the image, then image registration and stitching are carried out, and the multiple-side image is stitched into a complete unfolded image. Through image graying, binarization and morphological thinning, the crack is displayed in three dimensions, which provides support for the morphological display and topological analysis of the crack, improves the degree of automation, and provides technical support for the detection and analysis of split ceramic ware. It has strong innovation and practicability.


## 3. Research Methods

### 3.1. Image Acquisition and Processing

#### 3.1.1. Main Research Contents of VR Image Processing

The main research contents of VR image processing are as follows:(1)
Image transformation: due to the large image array, it is directly processed in the spatial domain, involving a large amount of calculation. Therefore, various image transformation methods, such as Fourier transform, Walsh transform, discrete cosine transform and other indirect processing technologies, are often used to convert the processing in spatial domain into transform domain processing, which can not only reduce the amount of calculation but also obtain more effective processing (for example, Fourier transform can carry out digital filtering processing in frequency domain).(2)
Image coding and compression: image coding and compression technology can reduce the amount of data describing the image (i.e. the number of bits), so as to save image transmission and processing time and reduce the occupied memory capacity. Compression can be achieved without distortion or under allowable distortion conditions. Coding is the most important method in compression technology. It is the earliest and mature technology in image processing technology.(3)
Image enhancement and restoration: the purpose of image enhancement and restoration is to improve the quality of the image, such as removing noise and improving the definition of the image. Image enhancement does not consider the reasons of image degradation and highlights the parts of interest in the image. If the high-frequency component of the image is enhanced, the outline of the object in the image can be clear and the details can be obvious; If the low-frequency component is enhanced, the influence of noise in the image can be reduced. Image restoration requires a certain understanding of the causes of image degradation. Generally speaking, a “degradation model” should be established according to the degradation process, and then some filtering method should be used to restore or reconstruct the original image.(4)
Image segmentation: image segmentation is one of the key technologies in VR image processing. Image segmentation is to extract the meaningful features in the image. The meaningful features include edges and regions in the image, which is the basis for further image recognition, analysis, and understanding. Although many methods of edge extraction and region segmentation have been studied and there is no effective method generally applicable to all kinds of images. Therefore, the research on image segmentation is still in-depth, and it is one of the hotspots in image processing.(5)
Image classification (recognition): Image classification (recognition) belongs to the category of pattern recognition. Its main content is image segmentation and feature extraction after some preprocessing (enhancement, restoration, and compression), so as to make decision classification. Image classification often adopts classical pattern recognition methods, including statistical pattern classification and syntactic (structural) pattern classification. In recent years, the newly developed fuzzy pattern recognition and artificial neural network pattern classification have also attracted more and more attention in image recognition [16].


#### 3.1.2. Advantages of Using VR Image Processing for Crack Detection

The application of VR image processing to nondestructive defect detection is not new, but it is basically limited to detecting the outer surface of the workpiece. So far, there is no good solution for the detection of inner surface, especially the detection of opaque inner surface. Based on some VR image processing systems, this paper designs a set of VR image processing system for detecting inner surface cracks of workpieces. Compared with the three traditional nondestructive testing methods mentioned earlier, the system has the following advantages:(1)
Completely contactless:The image sensor can obtain the required image without contacting the workpiece;(2)
There is no need to deal with the workpiece in advance:Traditional testing methods, such as ultrasonic testing, need to coat a layer of acoustic bonding medium (oil or water) on the surface of the tested workpiece in advance to make most of the energy enter the tested workpiece, and then clean it after testing; The same is true for penetrant testing. First, apply a layer of developer on the surface of the workpiece to be tested and then clean it after testing. The image processing method does not need to process the workpiece at all, and only needs to provide a light source for the image sensor.(3)
Fast detection speed and easy to realize real-time automatic detection:At present, using the software of this subject to detect the crack in a 640 × 480 pixel picture on p4-2.4g PC only takes about 100 ms. Owing to the rapid development of processor, the time consumed by VR image processing algorithm will be shorter and shorter, so it is easy to realize real-time automatic detection.(4)
Low cost.Cameras have been very common in daily life, and home computers have now entered the dual core era. Therefore, a set of high-performance VR image processing system can be established at a very small cost [17].


### 3.2. Corner Detection and Feature Matching

#### 3.2.1. Corner Detection

In the field of image processing, corners are often feature points with two main directions in the intersection or neighborhood of two edges; Corner detection is used for feature extraction, target matching, and 3D reconstruction. Harris corner detection is the basis of feature point detection. Moving window is used to calculate the gray difference of adjacent pixels to judge corners, edges, and smooth areas. Among them, the key processes include image graying, calculation of differential image, Gaussian smoothing, calculation of local extreme value, and confirmation of corner points. Harris algorithm detects corners by calculating the curvature and gradient of points. It is insensitive to the changes of brightness and contrast and has rotation invariance, scale invariance, high robustness, and computational efficiency [18]. The core of Harris algorithm is to use the local window to move on the image to judge the change of gray level. The points with large changes in two directions are corners; There is no corner without change; If the window changes significantly when moving in only one direction, the point may be in a straight line. Judge the corner by formula (1).(1)Εu,v≅u,vMuv,where u,v is the offset of the window; M is the covariance matrix, as shown in formula (2).(2)M=∑x,ywx,yIx2IxIyIxIyIy2,where (x, y) is the pixel coordinate and W(x, y) is the window function. The simplest case is that the weight coefficients corresponding to all pixels in the window are 1; Ix is the gradient in the x direction; and Iy is the gradient in the y direction. When the eigenvalues of M are relatively large, that is, there are corners in the window; One of the eigenvalues is larger and the other is smaller, and the window contains edges; The eigenvalues are relatively small, and the window is in a flat area.Rgb2 gray () function in MATLAB is used to convert RGB image into gray image, which is convenient to calculate the gradient change in gray image. The Harris corner is detected by the function statement [XP, YP, value] = Harris (input_image, sigma, thd, R), where the input parameter is input_Image indicates the input grayscale image; Sigma represents the standard deviation of smooth Gaussian;R represents the radius of the area considered in nonmaximum suppression; The output parameter XP represents the X coordinate of the corner; YP represents the Y coordinate of the corner; and Value represents the R value at the corner.


#### 3.2.2. Feature Matching

As there are many key points detected by Harris algorithm, direct calculation will increase the amount of calculation and error. It is necessary to screen out the key corners with obvious characteristics relatively evenly. Matthew proposed an adaptive nonmaximum suppression (anms) method to select a specific number of key points. First select the candidate points with high scores to form a sets. For each point xi in s, find the region radius ri whose response can be taken as the maximum value of the region, that is,(3)ri=minxi−xy,where, ri=minxi−xy. Arrange the ri found in descending order, and select the points corresponding to the first 50 elements, that is, the key points obtained after adaptive nonmaximum filtering. xi is the two-dimensional coordinate of the key points obtained in the previous step, and S is the set of all key points [19].


### 3.3. VR Image Processing Technology for Ceramic Bottle Crack Detection Based on Three-Dimensional Reconstruction Algorithm

At present, according to different cameras, there are three kinds of 3D reconstruction: monocular reconstruction, binocular reconstruction, and rgbd camera reconstruction. For monocular reconstruction, there are mainly two categories: offline reconstruction and online reconstruction. For offline reconstruction, the most classic is switch fabric module (SFM) reconstruction. SFM algorithm is an offline algorithm for three-dimensional reconstruction based on various collected disordered images. First, it uses the scale invariant feature transform (SIFT) algorithm to extract image features, then calculates the Euclidean distance of the corresponding descriptor in the two images, matches the SIFT feature points according to the distance and calculates the basic matrix according to the epipolar geometry to form the trajectory. Then initialize the whole process with the selected image to obtain the geometric information of the scene. For online reconstruction, there are mainly progressive reconstruction and direct reconstruction. Progressive reconstruction uses the image at the next moment to continuously fuse the previous three-dimensional information. The main algorithm is remode algorithm. Direct reconstruction uses the images of several moments (generally several frames to dozens of frames) to complete the three-dimensional reconstruction of the same scene at one time. Direct reconstruction is also known as deep fusion. It has less images involved in calculation and high real-time performance.


#### 3.3.1. Flow Chart of Crack Image Processing of Ceramic Bottle

The image collected by the image card is stored in memory in the form of “frame”. The application program can extract and process the data of any “frame” at any time. The core task of VR image processing system is to use specific algorithms to identify the required information from a “frame” image. There are usually many methods to achieve the goal, but the effect and efficiency obtained by using different algorithms or steps may be quite different. The software used in this subject adopts modular design, and each module is relatively independent. Therefore, the image processing steps can be adjusted according to the actual needs. The basic flow of crack treatment is shown in Figure2:Figure 2
Flow chart of crack image processing of ceramic bottle.The first step of graphics processing is generally to preprocess the image. Image preprocessing mainly completes the light compensation, smoothing, and other operations of the target image. Its ultimate purpose is to provide the following processing with as effective image data as possible:The second step is edge detection, that is, highlight the gray change area in the image through some algorithm. As the biggest difference between the cracked area and the area without crack is that the gray is different, so this step is very key. As various edge detection operators have strong pertinence; therefore, we will introduce various algorithms and compare their actual effects in our application.The third step is to filter the image after edge detection. Although the image has been smoothed in the first step, some noise points may appear after threshold segmentation, which will have a negative impact on the subsequent crack recognition. Therefore, it is necessary to filter the image before Binarization in order to remove the noise points.The fourth step is image binarization. This operation separates the crack from the background. Although this operation is easy to understand, the effect obtained using different methods is still very different.The last step is the automatic identification of cracks. If handled properly, the binarized image should only have two gray levels: crack and background. Human eyes can easily identify cracks, but in order to realize automatic control, we need to let the computer identify cracks by itself, in which the projection method is used to detect the length and width of cracks.


#### 3.3.2. Gray Histogram

To study VR images, we must first understand the histogram.Histogram is the simplest and most useful tool in VR image processing. Gray histogram summarizes the gray level content of an image. The histogram of any image contains considerable information, and some types of images can be completely described by their histograms. The calculation of histogram is relatively simple, especially when a picture is copied from one place to another, the calculation of histogram can be completed at a very low cost [20]. Gray histogram is a function of gray level, which describes the number of pixels with this gray level in the image; The abscissa is the gray level, and the ordinate is the frequency of the gray level (the number of pixels). The probability distribution of probability and probability of PDF can be regarded as the probability distribution of probability histogram, which corresponds to the probability density of PDF. Figure 3 is a typical gray histogram. The number marked on the ordinate represents the number of pixels with the gray level that appears most frequently.Figure 3
Gray histogram of a crack image of a ceramic bottle.In the process of image preprocessing, most operations are related to histogram, such as adjusting brightness, adjusting contrast, and sharpening.


### 3.4. Image Preprocessing

Image preprocessing is some operations such as image enhancement and restoration aiming at the defects of the acquired image itself and the specific research purpose. As we use a nonstandard camera light source, the light intensity and scattering direction are not easy to adjust. In addition, the equipment may vibrate during the shooting process, which may distort the captured image to a certain extent. Here, according to the actual situation, first use the point processing method to trim the image data, such as light compensation, and then use the image smoothing technology (average neighborhood method or median filter) to preprocess the crack image. Generally speaking, image preprocessing can be divided into two categories: point operation and neighborhood operation. The following introduces these methods one by one, and then applies them to deal with crack images.In image processing, point operation is a simple but important technology, which allows users to change the gray range of image data. For an input image, an output image will be generated after point operation, and the gray value of each pixel of the latter is only determined by the value of the corresponding input pixel (the difference between this method and local operation is that the gray value of each output pixel of the latter is determined by the gray value of several pixels in a neighborhood of the corresponding input pixel). The point operation does not change the spatial relationship in the image. The applications of point operation include contrast enhancement, contrast stretching, gray transformation, and so on. It is an important part of image digitization software and image display software. The point operation changes the gray histogram of an image in a predetermined way. Except that the change of gray level is based on a specific gray transformation function, point operation can be regarded as a copy operation from pixel to pixel. The operations used in this subject, such as light compensation, removal of bright spots and gray equalization, all belong to the category of point operation. The principle of light compensation is relatively simple, that is, multiply each point in the image by a coefficient to improve the brightness of the image. This coefficient must make the brightness of the point with the highest brightness in the original image close to 255 after operation. From the perspective of histogram, light compensation is to move the “peak” of histogram to the right as much as possible. We can easily see this from the comparison of Figures4 and 5.Figure 4
A crack image and its histogram.Figure 5
Crack image and its histogram after light compensation.Removing bright spots is an algorithm specially designed for the point light source used in this subject. The purpose is to reduce the influence of light spot on later crack detection. The algorithm principle used in this paper is relatively simple, that is, all pixels whose brightness exceeds a certain value in the image are set as the average gray value of the image. However, in the actual use process, it is found that the processing effect of this algorithm is not ideal, and the cracks in the bright spots may be removed. Therefore, it is necessary to continue to study more advanced and effective algorithms.


## 3.1. Image Acquisition and Processing

### 3.1.1. Main Research Contents of VR Image Processing

The main research contents of VR image processing are as follows:(1)
Image transformation: due to the large image array, it is directly processed in the spatial domain, involving a large amount of calculation. Therefore, various image transformation methods, such as Fourier transform, Walsh transform, discrete cosine transform and other indirect processing technologies, are often used to convert the processing in spatial domain into transform domain processing, which can not only reduce the amount of calculation but also obtain more effective processing (for example, Fourier transform can carry out digital filtering processing in frequency domain).(2)
Image coding and compression: image coding and compression technology can reduce the amount of data describing the image (i.e. the number of bits), so as to save image transmission and processing time and reduce the occupied memory capacity. Compression can be achieved without distortion or under allowable distortion conditions. Coding is the most important method in compression technology. It is the earliest and mature technology in image processing technology.(3)
Image enhancement and restoration: the purpose of image enhancement and restoration is to improve the quality of the image, such as removing noise and improving the definition of the image. Image enhancement does not consider the reasons of image degradation and highlights the parts of interest in the image. If the high-frequency component of the image is enhanced, the outline of the object in the image can be clear and the details can be obvious; If the low-frequency component is enhanced, the influence of noise in the image can be reduced. Image restoration requires a certain understanding of the causes of image degradation. Generally speaking, a “degradation model” should be established according to the degradation process, and then some filtering method should be used to restore or reconstruct the original image.(4)
Image segmentation: image segmentation is one of the key technologies in VR image processing. Image segmentation is to extract the meaningful features in the image. The meaningful features include edges and regions in the image, which is the basis for further image recognition, analysis, and understanding. Although many methods of edge extraction and region segmentation have been studied and there is no effective method generally applicable to all kinds of images. Therefore, the research on image segmentation is still in-depth, and it is one of the hotspots in image processing.(5)
Image classification (recognition): Image classification (recognition) belongs to the category of pattern recognition. Its main content is image segmentation and feature extraction after some preprocessing (enhancement, restoration, and compression), so as to make decision classification. Image classification often adopts classical pattern recognition methods, including statistical pattern classification and syntactic (structural) pattern classification. In recent years, the newly developed fuzzy pattern recognition and artificial neural network pattern classification have also attracted more and more attention in image recognition [16].


### 3.1.2. Advantages of Using VR Image Processing for Crack Detection

The application of VR image processing to nondestructive defect detection is not new, but it is basically limited to detecting the outer surface of the workpiece. So far, there is no good solution for the detection of inner surface, especially the detection of opaque inner surface. Based on some VR image processing systems, this paper designs a set of VR image processing system for detecting inner surface cracks of workpieces. Compared with the three traditional nondestructive testing methods mentioned earlier, the system has the following advantages:(1)
Completely contactless:The image sensor can obtain the required image without contacting the workpiece;(2)
There is no need to deal with the workpiece in advance:Traditional testing methods, such as ultrasonic testing, need to coat a layer of acoustic bonding medium (oil or water) on the surface of the tested workpiece in advance to make most of the energy enter the tested workpiece, and then clean it after testing; The same is true for penetrant testing. First, apply a layer of developer on the surface of the workpiece to be tested and then clean it after testing. The image processing method does not need to process the workpiece at all, and only needs to provide a light source for the image sensor.(3)
Fast detection speed and easy to realize real-time automatic detection:At present, using the software of this subject to detect the crack in a 640 × 480 pixel picture on p4-2.4g PC only takes about 100 ms. Owing to the rapid development of processor, the time consumed by VR image processing algorithm will be shorter and shorter, so it is easy to realize real-time automatic detection.(4)
Low cost.Cameras have been very common in daily life, and home computers have now entered the dual core era. Therefore, a set of high-performance VR image processing system can be established at a very small cost [17].


## 3.1.1. Main Research Contents of VR Image Processing

The main research contents of VR image processing are as follows:(1)
Image transformation: due to the large image array, it is directly processed in the spatial domain, involving a large amount of calculation. Therefore, various image transformation methods, such as Fourier transform, Walsh transform, discrete cosine transform and other indirect processing technologies, are often used to convert the processing in spatial domain into transform domain processing, which can not only reduce the amount of calculation but also obtain more effective processing (for example, Fourier transform can carry out digital filtering processing in frequency domain).(2)
Image coding and compression: image coding and compression technology can reduce the amount of data describing the image (i.e. the number of bits), so as to save image transmission and processing time and reduce the occupied memory capacity. Compression can be achieved without distortion or under allowable distortion conditions. Coding is the most important method in compression technology. It is the earliest and mature technology in image processing technology.(3)
Image enhancement and restoration: the purpose of image enhancement and restoration is to improve the quality of the image, such as removing noise and improving the definition of the image. Image enhancement does not consider the reasons of image degradation and highlights the parts of interest in the image. If the high-frequency component of the image is enhanced, the outline of the object in the image can be clear and the details can be obvious; If the low-frequency component is enhanced, the influence of noise in the image can be reduced. Image restoration requires a certain understanding of the causes of image degradation. Generally speaking, a “degradation model” should be established according to the degradation process, and then some filtering method should be used to restore or reconstruct the original image.(4)
Image segmentation: image segmentation is one of the key technologies in VR image processing. Image segmentation is to extract the meaningful features in the image. The meaningful features include edges and regions in the image, which is the basis for further image recognition, analysis, and understanding. Although many methods of edge extraction and region segmentation have been studied and there is no effective method generally applicable to all kinds of images. Therefore, the research on image segmentation is still in-depth, and it is one of the hotspots in image processing.(5)
Image classification (recognition): Image classification (recognition) belongs to the category of pattern recognition. Its main content is image segmentation and feature extraction after some preprocessing (enhancement, restoration, and compression), so as to make decision classification. Image classification often adopts classical pattern recognition methods, including statistical pattern classification and syntactic (structural) pattern classification. In recent years, the newly developed fuzzy pattern recognition and artificial neural network pattern classification have also attracted more and more attention in image recognition [16].


## 3.1.2. Advantages of Using VR Image Processing for Crack Detection

The application of VR image processing to nondestructive defect detection is not new, but it is basically limited to detecting the outer surface of the workpiece. So far, there is no good solution for the detection of inner surface, especially the detection of opaque inner surface. Based on some VR image processing systems, this paper designs a set of VR image processing system for detecting inner surface cracks of workpieces. Compared with the three traditional nondestructive testing methods mentioned earlier, the system has the following advantages:(1)
Completely contactless:The image sensor can obtain the required image without contacting the workpiece;(2)
There is no need to deal with the workpiece in advance:Traditional testing methods, such as ultrasonic testing, need to coat a layer of acoustic bonding medium (oil or water) on the surface of the tested workpiece in advance to make most of the energy enter the tested workpiece, and then clean it after testing; The same is true for penetrant testing. First, apply a layer of developer on the surface of the workpiece to be tested and then clean it after testing. The image processing method does not need to process the workpiece at all, and only needs to provide a light source for the image sensor.(3)
Fast detection speed and easy to realize real-time automatic detection:At present, using the software of this subject to detect the crack in a 640 × 480 pixel picture on p4-2.4g PC only takes about 100 ms. Owing to the rapid development of processor, the time consumed by VR image processing algorithm will be shorter and shorter, so it is easy to realize real-time automatic detection.(4)
Low cost.Cameras have been very common in daily life, and home computers have now entered the dual core era. Therefore, a set of high-performance VR image processing system can be established at a very small cost [17].


## 3.2. Corner Detection and Feature Matching

### 3.2.1. Corner Detection

In the field of image processing, corners are often feature points with two main directions in the intersection or neighborhood of two edges; Corner detection is used for feature extraction, target matching, and 3D reconstruction. Harris corner detection is the basis of feature point detection. Moving window is used to calculate the gray difference of adjacent pixels to judge corners, edges, and smooth areas. Among them, the key processes include image graying, calculation of differential image, Gaussian smoothing, calculation of local extreme value, and confirmation of corner points. Harris algorithm detects corners by calculating the curvature and gradient of points. It is insensitive to the changes of brightness and contrast and has rotation invariance, scale invariance, high robustness, and computational efficiency [18]. The core of Harris algorithm is to use the local window to move on the image to judge the change of gray level. The points with large changes in two directions are corners; There is no corner without change; If the window changes significantly when moving in only one direction, the point may be in a straight line. Judge the corner by formula (1).(1)Εu,v≅u,vMuv,where u,v is the offset of the window; M is the covariance matrix, as shown in formula (2).(2)M=∑x,ywx,yIx2IxIyIxIyIy2,where (x, y) is the pixel coordinate and W(x, y) is the window function. The simplest case is that the weight coefficients corresponding to all pixels in the window are 1; Ix is the gradient in the x direction; and Iy is the gradient in the y direction. When the eigenvalues of M are relatively large, that is, there are corners in the window; One of the eigenvalues is larger and the other is smaller, and the window contains edges; The eigenvalues are relatively small, and the window is in a flat area.Rgb2 gray () function in MATLAB is used to convert RGB image into gray image, which is convenient to calculate the gradient change in gray image. The Harris corner is detected by the function statement [XP, YP, value] = Harris (input_image, sigma, thd, R), where the input parameter is input_Image indicates the input grayscale image; Sigma represents the standard deviation of smooth Gaussian;R represents the radius of the area considered in nonmaximum suppression; The output parameter XP represents the X coordinate of the corner; YP represents the Y coordinate of the corner; and Value represents the R value at the corner.


### 3.2.2. Feature Matching

As there are many key points detected by Harris algorithm, direct calculation will increase the amount of calculation and error. It is necessary to screen out the key corners with obvious characteristics relatively evenly. Matthew proposed an adaptive nonmaximum suppression (anms) method to select a specific number of key points. First select the candidate points with high scores to form a sets. For each point xi in s, find the region radius ri whose response can be taken as the maximum value of the region, that is,(3)ri=minxi−xy,where, ri=minxi−xy. Arrange the ri found in descending order, and select the points corresponding to the first 50 elements, that is, the key points obtained after adaptive nonmaximum filtering. xi is the two-dimensional coordinate of the key points obtained in the previous step, and S is the set of all key points [19].


## 3.2.1. Corner Detection

In the field of image processing, corners are often feature points with two main directions in the intersection or neighborhood of two edges; Corner detection is used for feature extraction, target matching, and 3D reconstruction. Harris corner detection is the basis of feature point detection. Moving window is used to calculate the gray difference of adjacent pixels to judge corners, edges, and smooth areas. Among them, the key processes include image graying, calculation of differential image, Gaussian smoothing, calculation of local extreme value, and confirmation of corner points. Harris algorithm detects corners by calculating the curvature and gradient of points. It is insensitive to the changes of brightness and contrast and has rotation invariance, scale invariance, high robustness, and computational efficiency [18]. The core of Harris algorithm is to use the local window to move on the image to judge the change of gray level. The points with large changes in two directions are corners; There is no corner without change; If the window changes significantly when moving in only one direction, the point may be in a straight line. Judge the corner by formula (1).(1)Εu,v≅u,vMuv,where u,v is the offset of the window; M is the covariance matrix, as shown in formula (2).(2)M=∑x,ywx,yIx2IxIyIxIyIy2,where (x, y) is the pixel coordinate and W(x, y) is the window function. The simplest case is that the weight coefficients corresponding to all pixels in the window are 1; Ix is the gradient in the x direction; and Iy is the gradient in the y direction. When the eigenvalues of M are relatively large, that is, there are corners in the window; One of the eigenvalues is larger and the other is smaller, and the window contains edges; The eigenvalues are relatively small, and the window is in a flat area.Rgb2 gray () function in MATLAB is used to convert RGB image into gray image, which is convenient to calculate the gradient change in gray image. The Harris corner is detected by the function statement [XP, YP, value] = Harris (input_image, sigma, thd, R), where the input parameter is input_Image indicates the input grayscale image; Sigma represents the standard deviation of smooth Gaussian;R represents the radius of the area considered in nonmaximum suppression; The output parameter XP represents the X coordinate of the corner; YP represents the Y coordinate of the corner; and Value represents the R value at the corner.


## 3.2.2. Feature Matching

As there are many key points detected by Harris algorithm, direct calculation will increase the amount of calculation and error. It is necessary to screen out the key corners with obvious characteristics relatively evenly. Matthew proposed an adaptive nonmaximum suppression (anms) method to select a specific number of key points. First select the candidate points with high scores to form a sets. For each point xi in s, find the region radius ri whose response can be taken as the maximum value of the region, that is,(3)ri=minxi−xy,where, ri=minxi−xy. Arrange the ri found in descending order, and select the points corresponding to the first 50 elements, that is, the key points obtained after adaptive nonmaximum filtering. xi is the two-dimensional coordinate of the key points obtained in the previous step, and S is the set of all key points [19].


## 3.3. VR Image Processing Technology for Ceramic Bottle Crack Detection Based on Three-Dimensional Reconstruction Algorithm

At present, according to different cameras, there are three kinds of 3D reconstruction: monocular reconstruction, binocular reconstruction, and rgbd camera reconstruction. For monocular reconstruction, there are mainly two categories: offline reconstruction and online reconstruction. For offline reconstruction, the most classic is switch fabric module (SFM) reconstruction. SFM algorithm is an offline algorithm for three-dimensional reconstruction based on various collected disordered images. First, it uses the scale invariant feature transform (SIFT) algorithm to extract image features, then calculates the Euclidean distance of the corresponding descriptor in the two images, matches the SIFT feature points according to the distance and calculates the basic matrix according to the epipolar geometry to form the trajectory. Then initialize the whole process with the selected image to obtain the geometric information of the scene. For online reconstruction, there are mainly progressive reconstruction and direct reconstruction. Progressive reconstruction uses the image at the next moment to continuously fuse the previous three-dimensional information. The main algorithm is remode algorithm. Direct reconstruction uses the images of several moments (generally several frames to dozens of frames) to complete the three-dimensional reconstruction of the same scene at one time. Direct reconstruction is also known as deep fusion. It has less images involved in calculation and high real-time performance.


### 3.3.1. Flow Chart of Crack Image Processing of Ceramic Bottle

The image collected by the image card is stored in memory in the form of “frame”. The application program can extract and process the data of any “frame” at any time. The core task of VR image processing system is to use specific algorithms to identify the required information from a “frame” image. There are usually many methods to achieve the goal, but the effect and efficiency obtained by using different algorithms or steps may be quite different. The software used in this subject adopts modular design, and each module is relatively independent. Therefore, the image processing steps can be adjusted according to the actual needs. The basic flow of crack treatment is shown in Figure2:Figure 2
Flow chart of crack image processing of ceramic bottle.The first step of graphics processing is generally to preprocess the image. Image preprocessing mainly completes the light compensation, smoothing, and other operations of the target image. Its ultimate purpose is to provide the following processing with as effective image data as possible:The second step is edge detection, that is, highlight the gray change area in the image through some algorithm. As the biggest difference between the cracked area and the area without crack is that the gray is different, so this step is very key. As various edge detection operators have strong pertinence; therefore, we will introduce various algorithms and compare their actual effects in our application.The third step is to filter the image after edge detection. Although the image has been smoothed in the first step, some noise points may appear after threshold segmentation, which will have a negative impact on the subsequent crack recognition. Therefore, it is necessary to filter the image before Binarization in order to remove the noise points.The fourth step is image binarization. This operation separates the crack from the background. Although this operation is easy to understand, the effect obtained using different methods is still very different.The last step is the automatic identification of cracks. If handled properly, the binarized image should only have two gray levels: crack and background. Human eyes can easily identify cracks, but in order to realize automatic control, we need to let the computer identify cracks by itself, in which the projection method is used to detect the length and width of cracks.


### 3.3.2. Gray Histogram

To study VR images, we must first understand the histogram.Histogram is the simplest and most useful tool in VR image processing. Gray histogram summarizes the gray level content of an image. The histogram of any image contains considerable information, and some types of images can be completely described by their histograms. The calculation of histogram is relatively simple, especially when a picture is copied from one place to another, the calculation of histogram can be completed at a very low cost [20]. Gray histogram is a function of gray level, which describes the number of pixels with this gray level in the image; The abscissa is the gray level, and the ordinate is the frequency of the gray level (the number of pixels). The probability distribution of probability and probability of PDF can be regarded as the probability distribution of probability histogram, which corresponds to the probability density of PDF. Figure 3 is a typical gray histogram. The number marked on the ordinate represents the number of pixels with the gray level that appears most frequently.Figure 3
Gray histogram of a crack image of a ceramic bottle.In the process of image preprocessing, most operations are related to histogram, such as adjusting brightness, adjusting contrast, and sharpening.


## 3.3.1. Flow Chart of Crack Image Processing of Ceramic Bottle

The image collected by the image card is stored in memory in the form of “frame”. The application program can extract and process the data of any “frame” at any time. The core task of VR image processing system is to use specific algorithms to identify the required information from a “frame” image. There are usually many methods to achieve the goal, but the effect and efficiency obtained by using different algorithms or steps may be quite different. The software used in this subject adopts modular design, and each module is relatively independent. Therefore, the image processing steps can be adjusted according to the actual needs. The basic flow of crack treatment is shown in Figure2:Figure 2
Flow chart of crack image processing of ceramic bottle.The first step of graphics processing is generally to preprocess the image. Image preprocessing mainly completes the light compensation, smoothing, and other operations of the target image. Its ultimate purpose is to provide the following processing with as effective image data as possible:The second step is edge detection, that is, highlight the gray change area in the image through some algorithm. As the biggest difference between the cracked area and the area without crack is that the gray is different, so this step is very key. As various edge detection operators have strong pertinence; therefore, we will introduce various algorithms and compare their actual effects in our application.The third step is to filter the image after edge detection. Although the image has been smoothed in the first step, some noise points may appear after threshold segmentation, which will have a negative impact on the subsequent crack recognition. Therefore, it is necessary to filter the image before Binarization in order to remove the noise points.The fourth step is image binarization. This operation separates the crack from the background. Although this operation is easy to understand, the effect obtained using different methods is still very different.The last step is the automatic identification of cracks. If handled properly, the binarized image should only have two gray levels: crack and background. Human eyes can easily identify cracks, but in order to realize automatic control, we need to let the computer identify cracks by itself, in which the projection method is used to detect the length and width of cracks.


## 3.3.2. Gray Histogram

To study VR images, we must first understand the histogram.Histogram is the simplest and most useful tool in VR image processing. Gray histogram summarizes the gray level content of an image. The histogram of any image contains considerable information, and some types of images can be completely described by their histograms. The calculation of histogram is relatively simple, especially when a picture is copied from one place to another, the calculation of histogram can be completed at a very low cost [20]. Gray histogram is a function of gray level, which describes the number of pixels with this gray level in the image; The abscissa is the gray level, and the ordinate is the frequency of the gray level (the number of pixels). The probability distribution of probability and probability of PDF can be regarded as the probability distribution of probability histogram, which corresponds to the probability density of PDF. Figure 3 is a typical gray histogram. The number marked on the ordinate represents the number of pixels with the gray level that appears most frequently.Figure 3
Gray histogram of a crack image of a ceramic bottle.In the process of image preprocessing, most operations are related to histogram, such as adjusting brightness, adjusting contrast, and sharpening.


## 3.4. Image Preprocessing

Image preprocessing is some operations such as image enhancement and restoration aiming at the defects of the acquired image itself and the specific research purpose. As we use a nonstandard camera light source, the light intensity and scattering direction are not easy to adjust. In addition, the equipment may vibrate during the shooting process, which may distort the captured image to a certain extent. Here, according to the actual situation, first use the point processing method to trim the image data, such as light compensation, and then use the image smoothing technology (average neighborhood method or median filter) to preprocess the crack image. Generally speaking, image preprocessing can be divided into two categories: point operation and neighborhood operation. The following introduces these methods one by one, and then applies them to deal with crack images.In image processing, point operation is a simple but important technology, which allows users to change the gray range of image data. For an input image, an output image will be generated after point operation, and the gray value of each pixel of the latter is only determined by the value of the corresponding input pixel (the difference between this method and local operation is that the gray value of each output pixel of the latter is determined by the gray value of several pixels in a neighborhood of the corresponding input pixel). The point operation does not change the spatial relationship in the image. The applications of point operation include contrast enhancement, contrast stretching, gray transformation, and so on. It is an important part of image digitization software and image display software. The point operation changes the gray histogram of an image in a predetermined way. Except that the change of gray level is based on a specific gray transformation function, point operation can be regarded as a copy operation from pixel to pixel. The operations used in this subject, such as light compensation, removal of bright spots and gray equalization, all belong to the category of point operation. The principle of light compensation is relatively simple, that is, multiply each point in the image by a coefficient to improve the brightness of the image. This coefficient must make the brightness of the point with the highest brightness in the original image close to 255 after operation. From the perspective of histogram, light compensation is to move the “peak” of histogram to the right as much as possible. We can easily see this from the comparison of Figures4 and 5.Figure 4
A crack image and its histogram.Figure 5
Crack image and its histogram after light compensation.Removing bright spots is an algorithm specially designed for the point light source used in this subject. The purpose is to reduce the influence of light spot on later crack detection. The algorithm principle used in this paper is relatively simple, that is, all pixels whose brightness exceeds a certain value in the image are set as the average gray value of the image. However, in the actual use process, it is found that the processing effect of this algorithm is not ideal, and the cracks in the bright spots may be removed. Therefore, it is necessary to continue to study more advanced and effective algorithms.


## 4. Result Discussion

In order to evaluate the measurement accuracy, the manual splicing method is used to convert the collected tea cup video on the rotating platform into image frames (600 frames) through MATLAB. It is analyzed that the rotating speed of the rotating platform is 20 s/week and the frame rate of mobile phone video is 30 fps. The analysis shows that the displacement between two adjacent frames is 3 pixels. Starting from the first frame image, the 602nd to 604th column in the middle of the tea cup in the image is intercepted as the first-third column of the composite image; The 602 to 604 columns of the next frame image are intercepted in sequence and connected to the composite image in sequence until the 600th frame image, and the splicing of the composite image is completed. In the image frame, the diameter of the cylindrical tea cup is about 508 pixels and the circumference should be 1596 pixels; The length of the stitched image of the cylindrical surface of the tea cup obtained by the manual stitching method is 1800 pixels, and its stitching accuracy can be simply measured as 86.45% (i.e. the ratio of 1596 to 1800). The length of the stitched image obtained by the image stitching method proposed in this paper is 1697 pixels, and the stitching accuracy is 94.05% (i.e. the ratio of 1596 to 1697). In order to determine the generalization ability of the algorithm, 10 cracked porcelain cups with the same type but different glaze color are used for image acquisition and stitching. The effect of the splicing method proposed in this paper is evaluated, as shown in Table1. The splicing accuracy is more than 92%, which has high accuracy and effectiveness.Table 1
Accuracy evaluation of image mosaic.
Cracked porcelain cup no.The width of the stitched image is obtained by the method proposed in this paperAccuracy compared with the actual number of pixels (1596)1 (%)160192.662157493.613156294.304160392.015157693.506160492.057160692.408157293.729158093.2710157793.44When the color crack image is converted into black-and-white thinning image, a few thinning lines are broken. The reason should be that the light collected from the video is provided by two LED light strips at the top, so that the lighting intensity at the bottom is slightly lower than that at the top. Although the image is binarized and the dynamic display range is expanded, the uneven illumination still has an impact. In the follow-up, the adaptive correction algorithm should be used to deal with the problem of uneven illumination, and the noise of the image should be suppressed in combination with the filtering algorithm under the condition of preserving the detailed features of the image as much as possible. Through the cutting of video frames, Harris corner detection and image stitching, a complete stitching image of the side of the tea cup is obtained, which provides a basis for subsequent glaze color analysis and porcelain texture modeling and recognition. Through the commonly used image graying and binarization processing. The binary image of crack is not convenient for three-dimensional display and analysis due to the large image and many crack pixels (more than 100,000 pixels). In this paper, the thinning algorithm in morphology is used to refine the skeleton of the crack, which is convenient for the subsequent morphological display and topological analysis of the crack. In this paper, the processing and analysis of crack image takes short time, has real-time and robustness, and has certain practical value in the analysis of crack porcelain such as tea cup.


## 5. Conclusion

Aiming at the problem that it is difficult to detect the inner wall of ceramic bottle, a corner detection of ceramic crack computer VR image based on three-dimensional reconstruction algorithm is proposed in this paper. VR image processing technology was used to detect ceramic cracks. After design, research, and debugging, the system has been preliminarily formed, which has laid a solid foundation for further research in the future. The conclusions in the whole process are as follows: the image mosaic of the patterns on the surface of cracked porcelain can be better applied to the analysis of external features such as texture and porcelain identification. Image processing technology can realize rapid and nondestructive ceramic inspection and analysis and make up for the shortcomings of traditional inspection methods. Taking the celadon teacup with cracked glaze as the research object, this paper extracts multiple-side images of porcelain, extracts the corners in the image by Harris corner detection method, then carries out image registration and stitching, and stitches the multiple-side images into a complete image. Through image graying, binarization and morphological thinning, the crack is displayed in three dimensions, which provides support for the morphological display and topological analysis of the crack and has strong innovation and practicability.



---

*Source: 8720447-2022-06-08.xml*