A Denoising Scheme for Scanned Wood Grain Images via Adaptive Color Substitution

: Real-world image denoising is a challenging problem in low-level vision. In order to reduce the luminance noise on scanned wood grain images randomly generated by the Microtek Phantom 9900XL scanner, the images were classiﬁed and sorted according to the noise size. The proposed denoising scheme reduces noise by substituting dissimilar pixels within a certain window size. The No.1 to No. 6 wood images with noise size of approximately (or no greater than) 3 pixels × 3 pixels were processed using coarse denoising with a 7 × 7 window ( α = 100, β = 30), ﬁne denoising with a 5 × 5 window ( α = 90, β = 40), and the Dust & Scratches ﬁlter at settings of 1 (pixels) and 35 (levels). The No.7 to No. 16 wood images with noise size of approximately (or no greater than) 1 pixel × 1 pixel were processed using ﬁne denoising with a 5 × 5 window ( α = 100, β = 30), and the Dust & Scratches ﬁlter at settings of 1 (pixel) and 35 (levels). The proposed Scheme I and II was then compared with Wiener ﬁltering, Gaussian ﬁltering, median ﬁltering, and the Dust & Scratches ﬁlter under designated settings. The results of subjective and objective evaluations demonstrated that the proposed Scheme outperformed the above denoising methods on reducing the luminance noise. When using the median values of R (red), G (green), and B (blue) channels within a certain window to substitute the R, G, and B values of the luminance noise, the denoising ranges of α ≥ 100 and β ≤ 30 were suitable for the No.1 to No.16 wood images.


Introduction
Various visual characteristics of wood, which are broadly categorized into rich colors, varied textures, and mellow gloss, contribute to the unique appearance of wood. To imitate such excellent visual characteristics of natural wood grain, wood veneer [1] and decorative papers have been widely applied in the finishings of construction, panels, large furniture products, etc. These two surface decoration techniques, as well as the three-dimensional (3D) wood grain produced by ultraviolet (UV)-curable inkjet printing, are all realized based on two-dimensional (2D) images [2]. Thus, this paper will focus on the 2D digital wood grain that can be applied to the surface decoration of forest products. Unique from the research purposes of classification or recognition of wood species [3] and the detection of defects on wood surfaces [4], digital wood grain used for surface decoration is generally acquired in a static environment rather than a dynamic one.
Scanners and cameras are the commonly-used devices for the static image acquisition. In particular, flatbed scanners have the advantages of uniform illumination and freedom from stray light. The ability to recognize the nuances of color gradients is superior on charge-coupled device (CCD) scanners; color fidelity is greater and the range of colors is also wider [2]. As a result, the flatbed CCD scanner is often selected as the equipment for the digitization of color wood grain when it comes to the surface decoration with wood grain.
The optically scanned images captured using scanner sensors are often contaminated by noise (undesired random signal) [5][6][7]. The noise filter Dust & Scratches in Photoshop CC 2018 (Adobe Inc., San Jose, CA, USA) can reduce different types of noise by changing dissimilar pixels, and the balance between hiding defects and protecting image details can be achieved if it is controlled properly [8]. However, image details will be damaged to varying degrees when using the Dust & Scratches filter to reduce noise.
To solve this problem, Wen et al. [9] presented an efficient denoising method based on a Shearlet applied on the tree radar images, and proved that the proposed method had the best denoising performance in preserving the edge information. To promote structural smoothness and edge preservation in the image, Tan et al. [10] introduced a novel denoising method by combining the total variation (TV) regularization. To sum up, existing studies on image denoising methods are mostly aimed at reducing noise; meanwhile, enhancing or protecting image edges and textures.
The authors normally assume that the noise of distorted images is additive white Gaussian noise (AWGN) [15]. For example, Abdul Hamid et al. [16] proposed an image denoising module for wood images by using the expectation-maximization (EM) adaption algorithm, and the performance of the proposed module was compared to several classic denoising filters at various AWGN noise levels. The downside is that the EM adaption algorithm will become much less effective when dealing with the realistic noise captured by CCD cameras, because the realistic noise is much more complex than AWGN [13]. The testing of the effectiveness of these denoising algorithms on the publicly available real-world noisy image datasets is still demanded [17].
However, industrial wood images are different from the publicly available ones. Because of the disparate shooting or scanning conditions, the above-mentioned algorithms can still be invalid in the denoising of the scanned wood grain images even if the effectiveness of these algorithms on the publicly available image datasets has been tested. Moreover, for the images that will be applied to the large-scale production of decorative wood grain, these denoising algorithms in the literature are time-consuming and inefficient, since shorter processing time is crucial when dealing with large wood image databases [16].
In this paper, a denoising scheme for the scanned wood grain images via adaptive color substitution was proposed. It can be directly applied to realistic noise captured by CCD cameras. Weight matrices to characterize the statistics of realistic noise and the publicly available real-world wood image datasets are not necessary, which is of great convenience for wood grain image processing. Specifically, after analyzing the luminance noise on the scanned wood images randomly generated by the Microtek Phantom 9900XL scanner, the median values of R (red), G (green), and B (blue) channels within a certain window were used to substitute the R, G, and B values of the luminance noise that meet certain conditions, respectively. This denoising scheme is low in complexity, thereby, fast in computation, and especially suited to images that will be applied to large-scale production of decorative wood grain. Not only can it reduce the randomly generated noise on the scanned wood images effectively, but also preserve the texture details.

Source of Wood Images
The wood images for surface decoration were from 16 solid wood panels of different tree species. The surfaces of the solid wood panels were polished by waterproof abrasive 400-mesh paper and roller coated with waterborne transparent coatings. These clear and flat surfaces were then scanned by a CCD technology scanner (Phantom 9900XL, Microtek Co., Suzhou, China) with light-emitting diode (LED) light system, used according to reference [8].
One scanned plane was taken from each of the solid wood panels. Next, the 16 scanned planes were cropped to 120 mm × 900 mm (length × width), based on the size of the solid wood panels, and stored in a lossless TIFF format at 8 bits/channel and 300 pixels/inch resolution. Consequently, the image size of each scanned plane was 1417 pixels × 10,630 pixels with 256 gray levels. Table 1 shows the basic information of the 16 solid wood panels. They have been classified and sorted by the following rules: No.1 to No.6 are the scanned planes with noise size of approximately (or no greater than) 3 pixels × 3 pixels, and No.7 to No. 16 have noise size of approximately (or no greater than) 1 pixel × 1 pixel.  Table 2 shows the local parts of the scanned planes from No.1 to No.16, and the size of each local image is 59 pixels × 59 pixels (5 mm × 5 mm). The various sensor noises were categorized as either color noise or luminance noise [18]. It is obvious from Table 2 that the noise randomly generated by the Microtek Phantom 9900XL scanner is luminance noise.  Table 3 shows the mean, maximum, and minimum values of R, G, and B channels of the wood grain images from No.1 to No. 16. Table 4 shows the R, G, and B values of some random noise on these images.  1  135  137  161  102  122  141  130  137  154  2  173  152  147  120  118  160  133  115  127  3  168  149  152  145  107  133  129  132  123  4  167  158  157  162  140  160  192  179  189  5  193  176  183  178  157  172  196  184  179  6  166  158  164  196  180  173  175  171  183 From Table 3, the differences among the means of R, G, and B are significant; while from Table 4, the R, G, and B values of the random noise are quite close and relatively large, which is consistent with the characteristics of the luminance noise [18].
In summary, the R, G, and B values of the luminance noise to be replaced should meet the following conditions: |R − B| < β, |R − G| < β, and |G − B| < β, where α and β are the constants.
Based on the color values of the wood grain images in Table 3 and the pixel values of the luminance noise in Table 4, α ≥ 100 and β ≤ 30 are suggested. As α values decrease and β values increase, the probability of detecting the noise is higher.
As can be seen from Table 3, the maximum values of R, G, and B channels are mostly approaching to 255, and the minimum values of the three channels are mostly zero. Therefore, the median values of R, G, and B channels within a certain window were used to substitute the R, G, and B values of the luminance noise, respectively.

Noise-Searching Window
Texture details will be easier to lose and computation speed will be slower when the noise-searching window is large.
For the scanned planes from No.1 to No.6 with noise size of approximately (or no greater than) 3 pixels × 3 pixels, if the window size is set to 5 × 5, the median values within the window are more likely to be the noise pixels. Thus, the noise-searching window for the No.1 to No.6 scanned planes was set to 7 × 7.
The 7 × 7 window is shown in Figure 1a, where c ∈ {R, G, B}, I c (i, j) is the pixel value of one point at the image coordinate. Accordingly, for the scanned planes from No.7 to No.16 with noise size of approximately (or no greater than) 1 pixel × 1 pixel, the window size was set to 5 × 5 (Figure 1b), where ∈ R, G, B , ( , ) is the pixel value of one point at the image coordinate.

Algorithm Flow
For the scanned planes from No.1 to No.6 with visible noise, the value was set to 100 and the value was set to 30 when performing coarse denoising with the 7 × 7 window.
Notably, when performing fine denoising with the 5 × 5 window in the next step, the α value should be less than 100, and the β value should be more than 30, otherwise the luminance noise cannot be detected. Using this method, the image will not be changed in any way. For this reason, the value was reset to 90 and the value was reset to 40 when performing the fine denoising.
Since only fine denoising with the 5 × 5 window was to be performed on the scanned planes from No.7 to No.16 with visually unapparent noise, the value was set to 100 and the value was set to 30 directly. Figure 2 presents the algorithm flow chart, which is divided into three steps: (1) Decomposition of the source image, ; (2) Conditional judgment of the pixel values of R, G, and B channels within a certain window: if R > , G > , B > , |R − B| < , Accordingly, for the scanned planes from No.7 to No.16 with noise size of approximately (or no greater than) 1 pixel × 1 pixel, the window size was set to 5 × 5 (Figure 1b), where c ∈ {R, G, B}, I c (i, j) is the pixel value of one point at the image coordinate.

Algorithm Flow
For the scanned planes from No.1 to No.6 with visible noise, the α value was set to 100 and the β value was set to 30 when performing coarse denoising with the 7 × 7 window.
Notably, when performing fine denoising with the 5 × 5 window in the next step, the α value should be less than 100, and the β value should be more than 30, otherwise the luminance noise cannot be detected. Using this method, the image will not be changed in any way. For this reason, the α value was reset to 90 and the β value was reset to 40 when performing the fine denoising.
Since only fine denoising with the 5 × 5 window was to be performed on the scanned planes from No.7 to No.16 with visually unapparent noise, the α value was set to 100 and the β value was set to 30 directly. Figure 2 presents the algorithm flow chart, which is divided into three steps: (1) Decomposition of the source image, I; (2) Conditional judgment of the pixel values of R, G, and B channels within a certain window: if R > α, G > α, B > α, |R − B| < β, |R − G| < β, and |G − B| < β, the pixel at a certain point is considered as a noise pixel, and it should be substituted by the median values of R, G, and B channels within the window, respectively; otherwise the pixel at this point remains unchanged; (3) Merging the output R, G, and B channels to obtain the processed image, I out .
Because the substituted colors on the processed images could not be naturally fused with the surrounding colors, the noise filter Dust & Scratches at settings of 1 (pixels) and 35 (levels) was used after the above procedures, and the texture details of the non-lightcolored wood grain images could be well-preserved at this setting [8].

Subjective Observation
Two-scale decomposition was performed on the denoised images for better observation. It separates each source image into a base layer containing the large-scale variations in intensity and a detail layer containing the small-scale details by average filtering [19]. The base layer and detail layer of each source image are obtained as follows: and where c ∈ {R, G, B}, I c is the source image, B c is the base layer, D c is the detail layer, and Z is the average filter.  Because the substituted colors on the processed images could not be naturally fused with the surrounding colors, the noise filter Dust & Scratches at settings of 1 (pixels) and 35 (levels) was used after the above procedures, and the texture details of the non-lightcolored wood grain images could be well-preserved at this setting [8].  The size of the average filter was set to 1417 × 1417 as the image size of each scanned plane was 1417 pixels × 10,630 pixels. By selecting this large-size average filtering, the image details are fully extracted [20], thus, making it easier to observe the noise and the denoising effect of wood grain images.
The realistic noise varies among the different channels. As the noise is typically strongest in the blue channel [18], and denoising mainly works on this channel [21]; thus, the detail layer of the blue channel was chosen to exhibit the denoising effect.
Deviations from the statistical regularities observed in natural images (NI), i.e., the regularity of the natural scene statistic (NSS), enable these space domain algorithms with the capability of assessing the perceptual quality of an image without the need for any reference image [26] or the training on human-rated distorted images [24].
Since the scanned images are natural images [27], two of the NR-IQA metrics BRISQUE and NIQE were chosen to evaluate the quality of the denoised images. The lower these two values are, the better the images are perceived by the human eyes.

Results and Discussion
Two types of linear filters, Wiener filtering and Gaussian filtering, the non-linear median filtering, and the noise filter Dust & Scratches at settings of 1 (pixels) and 35 (levels) were compared to the proposed denoising algorithm.
All the experiments were implemented in MATLAB R2018b on a PC with an Intel (R) Core (TM) i7-8550U CPU, 8 GB RAM.

Denoising of the No.1 to No.6 Wood Images
As the noise size on the No.1 to No.6 wood images was approximately (or no greater than) 3 pixels × 3 pixels, the window size of the Wiener filtering, Gaussian filtering, and median filtering was set to 5 × 5. The window size of the Gaussian filtering is theoretically [6 × sigma − 1]/2 × 2 + 1 ([ ] represents taking an integer), so the standard deviation, σ, should be set to 5/6. If σ is large, the filtering effect improves, but the images become fuzzy [27]. For better denoising effect of the wood images, the σ was unified set to 1 in this paper. The proposed denoising Scheme I to be conducted on these images was divided into three steps:
Photoshop denoising using its Dust & Scratches filter at settings of 1 (pixels) and 35 (levels). Table 5 displays the local parts of the No.1 to No.6 wood images and their detail layers of the blue channels under different denoising methods. The size of each local image is 118 pixels × 118 pixels (10 mm × 10 mm).

Evaluation of Visual Effect
From Table 5, the noise on the No.1 to No.6 wood images denoised using median filtering almost disappeared, but these images were the most vague. The images denoised using Wiener filtering and Gaussian filtering also exhibited ambiguity in varying degrees.
The images denoised using the Dust & Scratches filter at settings of 1 (pixels) and 35 (levels) and the proposed denoising Scheme I retained more texture details, but in terms of denoising effect, the proposed Scheme I was better.
As the evaluation of visual effects could be influenced by subjective consciousness, an objective evaluation was implemented to further illustrate the denoising effect of different methods adopted in wood image processing.

Evaluation of BRISQUE and NIQE
The evaluation values of BRISQUE and NIQE of the No.1 to No.6 wood images under different denoising methods are shown in Table 6, and the normalization results of the corresponding values are shown in Figure 3.  From Figure 3, inside the red box, the BRISQUE values of the images denoised using the Dust & Scratches filter and the proposed denoising Scheme I were close and lower than the values of the corresponding originals, as were the NIQE values. This demonstrates that the wood images denoised using these two methods were all improved.
Outside the red box, the BRISQUE values of the images denoised using Wiener filtering, Gaussian filtering, and median filtering were higher than the values of the others. This demonstrates that the wood images denoised by these three methods were degraded, and the evaluation of BRISQUE on wood image quality was consistent with subjective observation. However, the NIQE values of the images denoised using Wiener filtering were abnormally low; according to the visual effect in Table 5, the evaluation of NIQE on wood image quality might be inaccurate. It is noted that the numerical values of BRISQUE and NIQE themselves are not comparable.
From Figure 3, inside the red box, the BRISQUE values of the images denoised using the Dust & Scratches filter and the proposed denoising Scheme I were close and lower than the values of the corresponding originals, as were the NIQE values. This demonstrates that the wood images denoised using these two methods were all improved. Outside the red box, the BRISQUE values of the images denoised using Wiener filtering, Gaussian filtering, and median filtering were higher than the values of the others. This demonstrates that the wood images denoised by these three methods were degraded, and the evaluation of BRISQUE on wood image quality was consistent with subjective observation. However, the NIQE values of the images denoised using Wiener filtering were abnormally low; according to the visual effect in Table 5, the evaluation of NIQE on wood image quality might be inaccurate.

Denoising of the No.7 to No.16 Wood Images
As the noise size of the No.7 to No.16 wood images was approximately (or no greater than) 1 pixels × 1 pixels, the window size of the Wiener filtering, Gaussian filtering, and median filtering was set to 3 × 3. The proposed denoising Scheme II which was going to be conducted on these images was divided into two steps:
Photoshop denoising of Dust & Scratches filter at settings of 1 (pixels) and 35 (levels).

Evaluation of Visual Effect
The No.7 to No.16 wood images denoised by Wiener filtering, Gaussian filtering, and median filtering all exhibited ambiguity to varying degrees.
There were only negligible subjective visual differences before and after these images were denoised using the Dust & Scratches filter at settings of 1 (pixels) and 35 (levels) and the proposed denoising Scheme II; thus, there were unapparent noise on these images and only the results of the objective evaluation for these images are displayed and discussed.

Evaluation of BRISQUE and NIQE
The evaluation values of BRISQUE and NIQE of the No.7 to No.16 wood images under different denoising methods are shown in Table 7, and the normalization results of the corresponding values are shown in Figure 4.
It is noted that the numerical values of BRISQUE and NIQE themselves are not comparable.
From Figure 4, inside the red box, the BRISQUE values of the images denoised by Dust & Scratches filter and the proposed denoising Scheme II were close, as were the NIQE values. Nevertheless, a few of the BRISQUE values of the images denoised using the two methods were higher than the values of the corresponding original images. This might be because there a negligible amount of noise on the No.7 to No.16 wood images; denoising caused image degradation.
Outside the red box, the BRISQUE values of the images denoised using Wiener filtering, Gaussian filtering, and median filtering remained higher, while some of the NIQE values were still abnormally low, which further confirmed the inaccuracy of the evaluation of NIQE on wood image quality.

Comparison to the Originals
To compare the difference between the processed images and the corresponding original images, the structural similarity (SSIM) [28] measure, based on the spatially localized measure of correlation in pixel values [29] was introduced.
A higher SSIM value means the structure of the processed image closely matches that of the original image, whereas a lower value means less structural similarity to the original. The SSIM values of the No.1 to No.16 wood images under different denoising methods are shown in Table 8. As seen in Table 8, the SSIM values of the images denoised using the Dust & Scratches filter and the proposed Scheme I and II were both closer to those of the originals. There could be changes in the relationships among the image pixels after the color substitution, leading to lower SSIM values of the proposed Scheme compared to those of the Dust & Scratches filter.
The differences in SSIM of the wood images No.1 to No.6 between the proposed Scheme and the Dust & Scratches filter were larger than the differences of the No.7 to No.16 wood images. This further confirmed that the noise was more distributed on the No.1 to No.6 wood images and verified the effectiveness of the color substitution method.
Overall, the No.1 to No.16 wood images denoised by the proposed Scheme showed more structural similarity to the originals in both subjective and objective evaluations.

Conclusions
The realistic noise on real-world noisy images captured by CCD cameras is complex due to the various factors in digital camera pipelines. In this paper, a novel denoising scheme for scanned wood grain images was proposed. It reduces visible noise by substituting dissimilar pixels within a certain window size in the spatial domain.
The No.1 to No.6 wood images denoised using Wiener filtering, Gaussian filtering, and median filtering exhibited ambiguity in varying degrees, and the BRISQUE values of these images were also higher. The images denoised using the Dust & Scratches filter at settings of 1 (pixels) and 35 (levels) and the proposed denoising Scheme I did not show fuzziness, but in terms of their denoising effects, the proposed Scheme I was better. The BRISQUE and NIQE values of these images were close and lower than the values of the corresponding original images, suggesting that the wood images denoised by the two methods were all improved. The results of subjective observation and objective evaluation indicated that the proposed Scheme I could reduce the randomly generated noise on the scanned wood images through color substitution, while preserving the texture details of the wood images with visible noise.
For the No.7 to No.16 wood images denoised using Wiener filtering, Gaussian filtering, and median filtering, the subjective and objective evaluations of them were consistent with those of the No.1 to No.6 wood images denoised by the three methods. There were negligible subjective visual differences between the images denoised by the Dust & Scratches filter at settings of 1 (pixels) and 35 (levels) and the proposed denoising Scheme II. The BRISQUE and NIQE values of these images were also close. The results of subjective observation and objective evaluation indicated that the denoising effect of the proposed Scheme II was consistent with that of the Dust & Scratches filter on the wood images with visually unapparent noise.
The scanned wood images were classified and sorted based on the size of luminance noise, and the classification denoising results showed that the ranges of α ≥ 100 and β ≤ 30 were suitable for the No.1 to No.16 wood images. Experiments demonstrated that for wood images scanned within the same batch, priority could be given to the analysis and denoising of images with evident noise.
This study focuses on the luminance noise on natural images, i.e., scanned wood grain images, and the ranges of α and β in this paper are only applicable to the denoising of wood images scanned by the Microtek Phantom 9900XL scanner. It is not difficult to find that through adjusting the denoising ranges and the size of noise-searching window, the proposed Scheme can also be applied to the denoising of other types of natural images with luminance noise.
For the other types of noise that may occur on real-world wood images, the method of color substitution may not be appropriate when the relationships among natural image pixels are particularly emphasized. Moreover, the state-of-the-art denoising methods on reducing realistic noise and their computational time should be compared with the proposed Scheme in the future studies.