Citation: Yang, T.; Xu, B.; Zhou, B.;
Wei, W. A Nonlinear Diffusion Model
with Smoothed Background
Estimation to Enhance Degraded
Images for Defect Detection. Appl.
Sci. 2023, 13, 211. https://doi.org/
10.3390/app13010211
Academic Editor: Silvia Liberata Ullo
Received: 9 November 2022
Revised: 13 December 2022
Accepted: 20 December 2022
Published: 24 December 2022
Copyright: © 2022 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
Article
A Nonlinear Diffusion Model with Smoothed Background
Estimation to Enhance Degraded Images for Defect Detection
Tao Yang
1,2,
*, Bingchao Xu
2
, Bin Zhou
3,
* and Wei Wei
4
1
School of Automation, Northwestern Polytechnical University, Xi’an 710072, China
2
Xi’an DataGo Information Technology Co., Ltd., Xi’an 710065, China
3
School of Sciences, Southwest Petroleum University, Chengdu 610500, China
4
School of Computer Science and Engineering, Xi’an University of Technology, Xi’an 710048, China
* Correspondence: taoyangnd@gmail.com (T.Y.); binzhou@swpu.edu.cn (B.Z.)
Abstract:
It is important to detect the defect of products efficiently in modern industrial manufac-
turing. Image processing is one of common techniques to achieve defect detection successfully. To
process images degraded by noise and lower contrast effects in some scenes, this paper presents a
new energy functional with background fitting, then deduces a novel model which approximates
to estimate the smoothed background and performs the nonlinear diffusion on the residual image.
Noise removal and background correction can be both successfully achieved while the defect feature
is preserved. Finally, the proposed method and some other comparative methods are performed on
several experiments with some classical degraded images. The numerical results and quantitative
evaluation show the efficiency and advantages of the proposed method.
Keywords: nonlinear; inhomogeneous; background estimation; variational; diffusion
1. Introduction
Image processing has become more and more important in many fields, such as
machine vision, geological prospecting, medical imaging, defect detection, and so on.
In the past decades, many methods have been presented based on different views, and
nonlinear diffusion is one of the most important techniques for the solid mathematical
physics foundation [
1
–
3
]. Different from the uniform diffusion (holds the same velocity
along any direction), nonlinear diffusion can be applied to describe lots of complex natural
phenomenons. Nonlinear diffusion models are often driven by partial differential equations
(PDEs) which can be derived by minimizing an energy functional and computing the Euler–
Lagrange equation [4,5].
Perona and Malik (PM) proposed a nonlinear diffusion model with a fixed edge stop
velocity function related to the local gradient mode [
6
]. It can be applied to achieve some
denoising tasks with homogeneous features and noise; however, it is difficult to efficiently
govern the diffusion process for some more complex cases. Rudin, Osher and Fatemi
(ROF) proposed the classical total variation model to recover noisy images by minimizing
a geometric energy functional [
1
]. The diffusion can be performed only along the edge to
preserve the image features and remove the noise.
Though these traditional methods have been reported to work well in many cases, they
are still found to show some unfavorable phenomena, such as the staircase effect, loss of
texture features, and so on [
7
,
8
]. Especially in many industrial scenes, the lighting condition
is limited, inhomogeneous and easy to be disturbed so that the observed images are often
low-contrast, have an inhomogeneous background and are serious polluted. It is often not
a good idea to directly apply the traditional models to these degraded images for defect
detection since the mentioned unfavorable effects often become worse in such situations.
Defects detection is often implemented on the images captured by some vision devices,
which are effected by some objective factors, such as noise level, brightness, background
Appl. Sci. 2023, 13, 211. https://doi.org/10.3390/app13010211 https://www.mdpi.com/journal/applsci