{'fraction_non_alphanumeric': 0.031512397510619385, 'fraction_numerical': 0.00755704830583819, 'mean_word_length': 4.824798619102417, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Efficient Anti-Glare Ceramic Decals Defect Detection by Incorporating Homomorphic Filtering

Nowadays the computer vision technique has widely found applications in industrial manufacturing process to improve their efficiency. However, it is hardly applied in the field of daily ceramic detection due to the following two key reasons: (1) Low detection accuracy as a result of ceramic glare, and (2) Lack of efficient detection algorithms. To tackle these problems, a homomorphic filtering based anti-glare ceramic decals defect detection technique is proposed in this paper. Considering that smooth ceramic surface usually causes glare effects and leads to low detection results, in our approach, the ceramic samples are taken in low light environment and their luminance and details restored by a homomorphic filtering based image enhancement technique. With relatively high quality preprocessed images, an effective ceramic decal defect detection algorithm is then designed to rapidly locate those out-of-bounds defects and further estimate their size. The experimental results show that the proposed scheme could achieve its desired performance.


Introduction
In general, traditional ceramic production has several disadvantages, such as low ductility, special production architecture, and uncontrolled quality of batch production, among others. During the ceramic production process, most existing daily ceramic detection techniques depend on manual operation, which leads to several problems, i.e., low efficiency, high-labor intensity, unstable products quality and high error rate. magnetic filed, to detect those object surface defects. However, the above-mentioned detection techniques are employed for object structural defect detection and should be cautiously chosen according to the detected object material. In addition, the out-of-bounds defect of ceramic decals is an appearance defect rather than a structural defect, which is not suitable for the above mentioned ways.
With the rapid development of computers, machine vision detection technique [5,6] has developed as a high-precision NDT, which could save human labor costs, improve productive automation [7][8][9] and achieve quality tracking [10,11]. However, the technique has not been widely applied to the ceramic industry, especially in the field of daily ceramics. Based on our best knowledge, just the paper [12] and our previously published paper [13] proposed a roundness detection algorithm for daily ceramics. Evidently, during the daily ceramics based NDT process, glare phenomenon is a significant factor to hinder the application of machine vision detection technique due to its glaze surface. It might cause some blurry areas in the image, leading to inaccurate detection results. In addition, some special defects exist in the daily ceramic production, such as the out-of-bounds defect of ceramic decals, which could not be effectively resolved by the current detection algorithms.
Based on the above analysis, how to effectively solve both glare and out-of-bound decal defect detection problems are significant for daily ceramics. Therefore, our manuscript is proposed. The contributions of this paper should be summarized as follows: (1) An effective daily ceramic anti-glare technique is proposed, which acquires some images under low light environment, and then employ a specially designed homomorphic filtering technique to increase its luminance and meanwhile maintain their details. (2) Based on above recovered images without glare phenomenon, a novel decal defect detection algorithm is developed, which could rapidly locate the outof-bound defect and further estimate their size.
The rest of this paper is organized as follows. Our proposed algorithm is presented in Section 2. Experiment results and discussions are listed in Section 3. Conclusions are offered in Section 4.

General Framework
As shown in Fig. 1, a homomorphic filtering based anti-glare ceramic out-of-bound defect defection algorithm is proposed in this paper. As shown in Fig. 1, the algorithm includes two modules: (1) Image enhancement. Ceramic images are sampled under low light circumstance to avoid glare phenomenon. However, it might cause blurry areas. Therefore, the homomorphic filtering-based image enhancement technique is employed to restore the luminance and details. (2) Defect detection. The detection algorithm includes the following steps, i.e., decal border extraction, indicative curve design, defect determination and defect size estimation. Both modules are described detailedly as follows.  Fig. 2, ceramic sampling image obtained in strong light circumstance might cause glare phenomenon due to its glaze surface. Therefore, those ceramic sampling images are captured in low light circumstance. However, this would cause low contrast and some indistinct details, as shown in Fig. 3.  As shown in Fig. 3, those images should be pre-processed to improve their visual quality. In general, both requirements should be met. Firstly, the dark background is desired to be unchanged since no ceramic defects are included in it. Secondly, other ceramic areas (except the dark background) should be enhanced to improve those details, which facilitates subsequent ceramic defect detection.
The pre-processing stage is performed with homomorphic filtering technique [14][15][16] and the process is mentioned as follows. In general, it is considered that a pixel gray value in one image is composed of two components, i.e., irradiation component and reflection component as shown in Eq. (1), where irradiation component represents slow change and corresponds to the low-frequency element and luminance information. While the reflection component is denoted as the sharp variation and means high-frequency elements and detail information. Therefore, to satisfy above-mentioned both requirements, those components should be discriminatively treated, such as the reflection component is desired to be enhanced to intensify those ceramic details and the irradiation component might be unchanged to keep the background information.
In this paper, the homomorphic filtering technique is employed to meet above requirements and discriminatively treat variable components. Specific algorithm is described as follows.

Homomorphic Filtering Process
In the subsection, a homomorphic filtering based anti-glare scheme for daily ceramics is designed. Among the scheme, a transfer function is involved and its parameters should be optimized. The process is mentioned as follows.
Step 1: Suppose a pixel f x; y ð Þ in the spatial domain based image could be composed of two components, i.e., irradiation component i x; y ð Þ and reflection component r x; y ð Þ.
where x and y present the horizontal and vertical coordinates of one image respectively.
where Inf x; y Step 3: Perform Fourier transform on Eq. (2) and obtain their elements in the frequency domain.
Step 4: Construct a frequency domain-based transfer function H u; v ð Þ to acquire Step 5: Through the inverse Fourier transform, some processed components in the spatial domain, i.e., f Ã x; y ð Þ; i Ã x; y ð Þ; r Ã x; y ð Þ, are obtained as follows.
Step 6: Then, Finally, Eq. (6) could be represented as According to above steps, original image f x; y ð Þ could be operated to be the enhanced image f ÃÃ x; y ð Þ.

Transfer Function Design and Parameters Optimization
During above-mentioned process, the enhanced image visual quality mainly depends on the specially designed transfer function H u; v ð Þ in Step 4. Therefore, to achieve desired enhanced anti-glare images, those parameters in H u; v ð Þ should be optimized. Firstly, based on our requirements, the design of transfer function H u; v ð Þ in homomorphic filtering process could refer to the traditional high pass filtering transfer function [17] as shown in Fig. 4a. However, traditional high pass filtering technique is generally used to weaken low-frequency and keep high-frequency unchanged. While our designed homomorphic filtering technique is designed to keep low frequency unchanged and enhance the high frequency. Therefore, the high pass filtering transfer function should be adjusted as shown in Fig. 4b.
As shown in Fig. 4a, traditional Butterworth high pass filtering transfer function is designed as follows: Transfer function H u; v ð Þ in homomorphic filtering process could be designed as follows and shown in Fig. 4b.
where H h is the high-frequency weight to indicate the enhanced effect for high-frequency; H l is the lowfrequency weight to denote the weaken effect for low-frequency; C is the sharpening coefficient. D 0 is pre-defined threshold to distinguish those low-frequency and high-frequency. In order to achieve desired performance, these parameters in Eq. (9) should be optimized. In general, to strengthen the details, H h is set as H h > 1. To maintain background unchanged, H l is set as 0 < H l < 1 and slightly less than 1. In addition, to enhance the luminance of ceramic part, D 0 is generally set to be a small value.

Module2-Ceramic Decal Out-of-Bound Detection
Based on the anti-glare image by using homomorphic filtering technique, ceramic decal defect detection algorithm is given in this section to determine those out-of-bound defects as shown in Fig. 5 and then estimate their sizes. Details are described as follows.

Ceramic Decal Region Extraction
In general, decal ceramics have two boundaries, i.e., the outermost boundary and the second outer boundary as shown in Fig. 6a, and the out-of-bound defect is normally located at the second outer boundary. To detect those defects, it needs to firstly extract the second outer boundary. Based on the idea, a residual based second outer boundary extraction algorithm is proposed and described as follows.
(1) To highlight these boundaries in an image, the binarization operation is performed. Among it, a binarization threshold T is calculated as follows.
where I r;c is the pixel gray value, R; C are the width and length of the given image respectively. The parameter is set to be 1.25.
After binarization process, the outermost border and the second outer border of the image are stood out as shown in Fig. 6a. (2) Performing the filling operation based on the outermost border to remove those inner details as shown in Fig. 6b. (3) By subtracting the binarization image from the filling image, a residual image is acquired to highlight the second outer border as shown in Fig. 6c.  Fig. 6c, those inner details in the second outer border of the residual image are covered as shown in Fig. 6d. Then a typical boundary extraction operator, i.e., Canny operator, could be employed to extract the second outer border, namely the decal border, as shown in Fig. 6e.

Decal Defect Detection for Out-of-Bound Defect
Based on the extracted decal border image as shown in Fig. 6e, namely the second outer border, a decal defect detection technique is proposed to locate the out-of-bound defect and then estimate its size. The process includes several steps: (1) Determine the circle center. (2) Design indicative curves. (3) Locate the decal out-of-bound defect (4) Estimate its size.

Determine the Circle Center
For the second outer border with a circular contour, a novel circle center determination algorithm is proposed as follows. Firstly, randomly select three points on the circular contour, and then collect their horizontal and vertical coordinates in the image, denoted as A x 1 ; y 1 ð Þ; A x 2 ; y 2 ð Þ; A x 3 ; y 3 ð Þ. Based on those three coordinates, the triangular circumcenter is determined, denoted as Oðx 0 ,y 0 Þ. Evidently, if the ceramic second outer border is a standard circle, the triangular circumcenter is just the circle center. According to the principle that distances from the circle center to points on the circle edge are identical, the circle center coordinates could be calculated by Apparently, the special cases, i.e., non-standard circular contour, might cause inaccurate circle center, which have been discussed in our previous work [11].

The Design of Indicative Curve a) Radius Curve
Based on the calculated circle center coordinates O x 0 ; y 0 ð Þ, employ L i ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi q to generate the radius array, denoted as L ¼ fL i ji 2 1; size ½ g ,where size means the number of points in the second outer border. Then those elements in L are utilized to draw a curve, denoted as radius curve.
As shown in Fig. 7, it is observed that some out-of-bound defects on the circular border will cause sudden mutation, which guides our defect detection. If the decal border is a standard circle, it is obvious that the radius curve should be a straight line. However, current ceramic industrial technique could not produce the ceramics with ideal circular decal border, which would cause unstable trend on the curve, as shown in Fig. 7. In addition, digital operations in the image acquisition device would cause jagged decal border, which could cause local dithering on the curve. Above interference might cause inaccurate defect detection. In the paper, the radius residual is introduced in the next subsection to restrain those undesired interference.

(b) Radius Residual Curve
To reduce those interference, i.e., overall unstable trend and local dithering for the radius curve, and meanwhile emphasize the sudden mutation for the out-of-bound defect, radius residual array is defined as fdif i ji 2 1; size ½ gand calculated by  where leg presents the length of adjacent chosen points. size denotes the number of boundary points. According to those elements in dif i , the curve is drew as shown in Fig. 8 and denoted as radius residual curve. Due to strong correlation between those adjacent elements in array L, the unstable trend and local dithering in radius residual curve can be efficiently restrained by Eq. (12). Meanwhile, the sudden mutation is emphasized.
(c) Radius Residual Exponential Curve From Fig. 8, it is observed that some slight residual local dithering also exists, which might interfere the decal out-of-bound defect location and its size estimation. Consequently, an improved radius residual curve, namely radius residual exponential curve, is introduced to further limit those local dithering. In addition, since exponential operation could enlarge the difference between normal areas and sudden mutation one, radius residual exponential curve could further emphasize those decals out-of-bound defect location. The radius residual exponential curve is calculated by where superscript x represents the power of radius residual curve.
When x ¼ 2 and x ¼ 3, the corresponding radius residual exponential curves are drawn in Fig. 9. Apparently, with the increase of x, sudden mutation is better emphasized.

Decal Out-of-bound Defect Location
Both kinds of radius residual exponential curves are provided to indicate different cases respectively, i.e., with the out-of-bound defect and without out-of-bound defect, as shown in Fig. 10. It is known that some concentrated pulses mean the sudden mutation and indicate the case with decal out-of-bound defect. By contrast, disperse pulse denotes the case without decal out-of-bound.
Based on the idea, we calculate the maximum value of radius residual exponential array dif x , denoted as max dif . Then those coordinates which are larger than 1 2 max dif in array dif x are recorded to construct an array Location and denoted as pulse coordinate array.
Later, the differences of adjacent elements in array Location are calculated to construct one array Location dif and denoted as pulse coordinate difference array.
When the number of those elements which are smaller than a preset threshold T Loc dif in Location dif is larger than 80% of the number of Location, it is considered that there are out-of-bound defects in the concentrated pulse regions. Otherwise the defect does not exist.
Above process could be utilized repeatedly to indicate multiple defects.

Size Estimation for Decal Out-of-bound Defect
If the out-of-bound defect size estimation is operated on radius curve, the width of the defect could be measured by using the distance between the start horizontal coordinate and the end one in the defect region as shown in Fig. 11a. Meanwhile, the height of the defect could be calculated by the difference between the maximum and minimum of vertical coordinates in the defect area. Due to unstable trend and large local dithering in radius curve, those coordinates could not be easily determined and thus the size estimation result could be interfered. To achieve better performance, the size could be estimated in radius residual curve.
As show in Fig. 11b, in the radius residual curve, the width of out-of-bound defect is similarly calculated by using the distance between the start horizontal coordinate and the end. However, the sudden mutation corresponding to the out-of-bound defect will generate two symmetrical pulses, i.e., positive peak þheight 1 and negative peak Àheight 2 . In the case, the height of out-of-bound defect could be approximately expressed as height 1 þ height 2 ð Þ =2. It is noted that the similar operation could be employed in the radius residual exponential curve.

Results and Discussions
To verify the efficiency of proposed algorithm, some experimental results are provided.

The Effectiveness of Homomorphic Filtering Technique
To avoid glare phenomenon, a ceramic bowl image is gained under low light circumstance as shown in Fig. 12a. It is clear that the image with low luminance would cause some indistinct details. Therefore, the proposed homomorphic filtering technique is employed to implement enhancement operation to restore luminance and details. Now, both kinds of different enhancement operations, i.e., proposed homomorphic filtering technique and traditional spatial-domain histogram equalization scheme, are performed for   Figs. 12b and 12c, respectively. It is observed that proposed homomorphic filtering technique achieves better visual quality. The reason is that homomorphic filtering technique could perform an adaptive enhancement for different regions in the image. For example, the background part is kept unchanged, and the detailed ceramic part is enhanced without anti-glare phenomenon.

Analysis of Decal Out-of-Bound Defect Detection
To determine the out-of-bound defects, the second outer border (decal border) should be completely extracted from the ceramic. As shown in Fig. 5, proposed scheme could exactly extract the second outer border. Then the efficiency of proposed defect detection algorithm is further verified as follows.
As shown in Fig. 13, two kinds of samples and correspond radius residual exponential curves are listed to indicate different situations, i.e., without out-of-bound defect and with out-of-bound defect respectively.
It is observed that one ceramic sample without out-of-bound defect generates a radius exponential curve with disperse pulse, as shown in Fig. 13a. In comparison, as shown in Fig. 13b, the radius residual exponential curve for a ceramic sample with out-of-bound defect leads to the concentrated pulse and the sudden mutation caused by defect is apparent. The phenomenon verifies our conclusion as mentioned in Section 2.3.2-(3).
Finally, according to the number of elements which are smaller than the threshold T loc dif in Location dif , it is easy to determine adaptively the out-of-bound defects. In addition, if the out-of-bound defects exist, their size could be estimated by using above proposed algorithm in Section 2.3.2-(4).

Execution Time and Efficiency
To further verify the accuracy of our proposed decal out-of-bound defect detection algorithm, its efficiency is testified. In this subsection, 1000 samples are chosen and tested by proposed defect detection algorithm. For the involved schemes, we implement the scheme with Matlab on 2.30 and 2.29 GHz Intel Xeon Gold 5118 dual core CPU with 64 GB memory. Experimental results are listed in Tab. 1. It is observed that our proposed algorithm could achieve high accuracy and affordable execution time, which demonstrates its practicability.