0% found this document useful (0 votes)
7 views

Fabric Fault Detection Using Image Processing in MATLAB

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Fabric Fault Detection Using Image Processing in MATLAB

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 10 Issue: 07 | July 2023 www.irjet.net p-ISSN: 2395-0072

Detection Of Faults In Fabric Using Image Processing In MATLAB


Dr. K. R. Desai1, Mr. Shree S. Kesarkar2
1Professor, Department of Electronics & Telecommunication, Bharati Vidyapeeth’s College of Engineering,
Kolhapur, Maharashtra, India.
2Student, Department of Electronics & Telecommunication, Bharati Vidyapeeth’s College of Engineering, Kolhapur,

Maharashtra, India.
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - In the textile industry, quality control is essential some companies who prioritize just-in-time delivery over
to competing in the fiercely competitive global market. In creating high-quality products.
these textile industries, faults in the fabric are discovered
through tedious, inaccurate manual testing. The profits of the The main goal of today's textile business is to produce First
textile business have decreased as a result of fabric faults, Quality, a high-quality fabric. This premium fabric is devoid
which cause unfavorable losses. To solve these issues and of any serious faults as well as any surface or minor
speed up and simplify defect diagnosis, an image processing structural imperfections. After the first quality, the
system has been implemented. When the patterns and textures remaining fabric is recognized as second-class fabric. A few
of a fabric are changed, the fabric's appearance and physical serious defects as well as countless structural or surface
properties are affected, which is known as a defect. Either flaws in this kind of fabric could cost the manufacturer
"minor" or "major" problems could exist. The faulty area must money. When selling second-quality fabric, just 45% to 65%
be located in order to cut the fabric correctly. In order to easily of the price of first-quality cloth is charged. Manufacturing
locate Fabric Texture defects, this project aims to create a tool. moves quickly, therefore the manufacturer needs to be able
The approach outlined in this proposal for labor lessens the to spot problems, figure out what caused them, and fix them
physical effort needed from the employees performing the very away. The load on the manufacturer's inspection teams
manual examination. To process images in this study, may increase as a result, and the output of second-quality
"MATLAB" is employed. Along with centimeters, pixels are fabric may decline while first-quality fabric production rises.
used to measure the fault's size. The fault's data Compared to hiring numerous employees, investing in
representation and its size are displayed using a histogram automated fabric fault identification is less expensive. Real-
and the GUI, respectively. time fabric inspection is a challenging undertaking because
there are many various types of problems based on the
Key Words: Fabric Faults, Flaw Measurement, Image weaving process employed and post-production issues like
Processing, MATLAB, Textile Industry holes and oil stains. While some defects can be detected by
sophisticated loom machines on their own, a large number of
1. INTRODUCTION flaws still require scrutiny after the weaving stage.
Therefore, enhancing the quality of materials requires
automated fabric inspection. The automated method for
In every industry, the quality factor is essential. In a similar
spotting fabric flaws will take care of imperfections in the
vein, a textile manufacturer must maintain production
fabric including holes, scratches, stretch, fly yarn, unclean
quality. Hand testing is still performed today to assess the
patches, cracked points, misprints, and color bleeding,
fabric's quality. The manual inspection result, however, falls
among others. If these defects are not discovered, the fabric
short of expectations due to complacency and disinterest.
businesses run the danger of losing money.
With the help of highly qualified inspectors, only 70% of
fabric faults can be identified. A basic cloth's defects can be
Automated fabric fault identification is feasible by utilizing
manually detected in about 90% of cases, but complicated
MATLAB's image processing method. With minimal work
materials are more difficult. Consequently, automated fabric
and expenditure, you might get superb precision using this
fault identification can lead to quick and high-quality
method. The faults in a captured image are discovered by
product manufacture. Recently, automated fabric inspection
using this MATLAB-based image processing technique. After
has attracted a lot of attention.
applying the noise filtering, histogram, and thresholding
processes to the image, the output is created. The fabric
The textile business, like other sectors, strives for high
image can be compared to other common textured images. It
quality and mass manufacturing in order to meet consumer
is vital to identify the precise position and severity of the
demands and reduce losses resulting from poor fabric
faults when deciding that the cloth is faulty. Patterns can be
quality and flaws. Rapid product flaw detection is necessary
detected anywhere in the visual area, regardless of their size,
due to the rapid pace of manufacturing. The larger roll sizes
brightness, or direction. This automation strategy can be
used to weave the cloth may result in lower production
used to address these problems
quality before any inspection. In this industry, there are

© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 246
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 07 | July 2023 www.irjet.net p-ISSN: 2395-0072

2. PROPOSED WORK the image. Filling the image also eliminates small holes.
There are little blobs on the edge of the image even after
The proposed work can be used by both small and large noise has been removed.
textile businesses. A single person with modest computer
abilities could operate and spot production issues. Human Using several MATLAB instructions, blobs smaller than 7
error can be removed by employing a conventional pixels and blobs on the border are deleted. The preferred
technique, such as manual testing. This suggested effort will fault can be chosen for measurement, and the value can be
make it possible to find and fix incredibly small problems that entered in the command box. As a result, the output displayed
are invisible to the human eye. The task's defined outcomes in the command window will be the centimeter-based
and histogram will be shown. The thresholding function is the measurement of the fabric flaws. It is useful to keep a record
result. The size of the defect will also be shown by the of faults since the displayed size of the fabric defect is thought
software. Accurate waste reduction techniques support to be the approximate size.
higher manufacturing quality. The textile industry needs this
proposed work as a preventative measure because there are 3. WORKING MODULES
numerous different types of fabric flaws, such as holes,
scratches, stretch, fly yarn, dirty spots, slub, cracked points, Using the imread function in MATLAB, you may read a
and colour bleeding that, if improperly detected, can have a picture. An image file is read from disc by the imread
significant negative impact on the manufacturing process. function, which then returns a matrix containing the image.
An image can be read using the simple syntax shown here:
imread=('image_file_path')

The path to the image file you want to read should be


substituted for 'image_file_path' in the code above. A relative
or an absolute path is possible. Numerous image file formats,
including JPEG, PNG, BMP, and TIFF, are supported by the
imread function. MATLAB uses the file extension to
determine the file format automatically. After being read, the
Fig-1: Block Diagram to identify the fault in fabric using image is stored in a matrix with each element denoting a
image processing in MATLAB pixel value. The image's resolution determines the matrix's
size. The matrix for a grayscale image will be M by N, where
With the use of color photographs that are taken of the cloth M is the number of rows and N is the number of columns.
being tested, the flaw in the fabric is located and measured. The matrix for a color image will be M by N by 3, indicating
The block diagram shown in Fig. 1 helps to illustrate the the red, green, and blue color channels. The image can then
entire procedure. be subjected to a number of processes utilizing MATLAB's
image processing tools, including image enhancement,
The input for the operation of this technique is a color image.
filtering, and analysis. To obtain the fault size in cm, the fault
To make algorithms and the extraction of picture descriptors
simpler, colour images are transformed to an 8-bit gray-level size noted on the defective image is entered in the command
format. Noise is caused by variations in lighting, the box. The image's flaw can be seen as pixels.
structure of the fabric, and imperfections in the fabric; it is
eliminated by filtering the image with a Weiner Low Pass There are various ways to change a colour image to
Filter or Median Filter. To clearly identify the problematic grayscale in MATLAB. Using the image's red, green, and blue
area, this filtered image is translated into binary form. channels as a weighted average is one of the often employed
techniques. The colour image is changed to grayscale by
Binary pictures can be used to indicate an image's region of using the formula.
interest. The image is changed into a bi-level image via
thresholding. Thresholding is used to isolate the pixels in an grayImage = rgb2gray(colorImage).
image that represent the item. On the thresholded image, the To determine the intensity of each pixel in the final grayscale
flaws are visible. image, this function computes the weighted average of the
RGB channels.
The flaws are displayed as data in a histogram output. A The Wiener filter is implemented via the wiener2 function, a
histogram is a sort of graph that shows how information is built-in image filtering tool in MATLAB. The Wiener filter is a
spread visually. A histogram can estimate the probability well-known method for picture restoration and denoising.
distribution of a given variable. The histogram is used to By reducing the mean square error between the estimated
categorize the fabric's flaws. The errors are corrected by and original images, it seeks to estimate the original image
utilizing the histogram's output. from a cluttered or degraded version. Utilizing the wiener2
function requires the following syntax:
It is required to eliminate the extremely small noise that is
J = wiener2(I, [m n], noiseVar)
present in the image in order to measure the defect's
approximate size. In order to increase the precision of the I is the input RGB or grayscale image. The local
diameter measurement, we must therefore extensively clean neighborhood size used for filtering is specified by [m n].

© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 247
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 07 | July 2023 www.irjet.net p-ISSN: 2395-0072

The function uses a default neighbourhood size of [3 3] if this shows the distance in pixels as you move it will emerge
optional parameter is not given. noiseVar is the additive when you click and drag on the image to draw a line.
noise's variance. Furthermore, it has an optional value. In the The formula 'H*0.0264583333' is used to convert the
event that it is not supplied, the function guesses it from the measured fault size to centimeters. The command pane
input image. It is also an optional parameter. The wiener2 displays the measured defect in millimeters.
function uses the input image to estimate a local image
variance, which it then uses to conduct adaptive noise 4. RESULTS
reduction. Then, using the estimated variance, a Wiener filter
is applied to each pixel in the image. In comparison to fixed
filters like Gaussian smoothing, the Wiener filter offers
better noise reduction because it changes its filter
coefficients to the local noise characteristics.

Utilize the imbinarize function to threshold the grayscale


image and create a binary image. Based on the image and the
intended outcome, you can set an acceptable threshold value.
As an alternative, you can utilize adaptive thresholding
techniques like 'imbinarize' with the 'adaptive' option.

A binary image's histogram gives a visual depiction of how


the image's pixel values are distributed. Since there are only
two potential pixel values in a binary image (usually 0 and
1), the histogram will display the frequency at which each
value occurs. The vertical axis of the histogram represents
the frequency or quantity of pixels that have a specific value, Fig-2: Original Image of fabric under test
while the horizontal axis displays the values of the pixels. A
binary image will have two bars that represent the frequency
of 0s and 1s. The function used is
histogram = imhist(binaryImage);
Based on their area (number of pixels), related components
of a binary picture can be filtered using MATLAB's
bwareafilter function. It's frequently used to eliminate little
or big items from binary images, keeping only the
components that are wanted according on their area.
filteredImage = bwareafilter(binaryImage, areaRange);
where: The input binary image with connected components
is called binaryImage. The required range of component
areas is specified by the two-element vector areaRange. The
lower threshold is the first element, while the upper barrier
is the second. Areas outside of this range in components will
be filtered away.
Fig-3: Gray Scale Image of fabric under test
The following actions are carried out by the bwareafilter
function: Label the connected components first: Using the
bwlabel function, it first labels the connected components in
the input binary image. Each component has its own specific
label. Component area computation: Using the regionprops
function and the 'Area' attribute, it then determines the area
of each connected component. The locations are kept in a
vector. Sort the elements: The function decides which
components to maintain and which to eliminate based on the
supplied areaRange. Areas outside the defined range for a
component are discarded. The function creates a new binary
image in which only the desired related components are kept
and all other pixels are set to 0. This is the filtered image.
The imdistline function is used to estimate distances in a
picture interactively. You can use it to draw a line on an
image and get the length in pixels or a chosen physical unit.
It activates the interactive mode by invoking imdistline
without any arguments. A draggable measurement tool that Fig-4: Noise Removed Image of fabric under test

© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 248
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 07 | July 2023 www.irjet.net p-ISSN: 2395-0072

Fig-8: Image with measured fault size

Fig-5: Binary Image of fabric under test

Fig-9: Measured size entered in command window in pixels

Fig-6: Histogram of Binary Image Fig-10: Fault size in centimeters

5. CONCLUSIONS
In this paper, a supervised defect detection approach has
been used to identify a class of fabric faults. The
experimental results on several flawed images show that it is
possible to spot fabric faults. The size of the fault is
quantified in pixels as well as in centimeters, and the faults
in fabric can be discovered and their data represented using
histograms. If there is no flaw on the cloth being tested, there
will be only one data representation in the histogram. Using
the MATLAB App feature, all of this functionality may be
performed in a GUI.

ACKNOWLEDGEMENT

We are grateful to our mentor Dr. K. R. Desai (Electronics


and Telecommunication Engineering Department, BVCOEK)
Fig-7: Image showing largest remaining blob/fault
for giving us the opportunity to work on this project and for
his continued intellectual support in the form of his astute
recommendations, instructions, and constructive criticism.
We are grateful that the members of the Electronics and

© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 249
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 07 | July 2023 www.irjet.net p-ISSN: 2395-0072

Telecommunication Engineering department accepted our Vol. 4, Issue 2, April - June 2013 ISSN: 0976-8491
project-related recommendations. We want to sincerely (Online) | ISSN: 2229-4333.
thank everyone who helped us finish this project, whether [10]. Matthew Wesolowski, ‘Using MATLAB to Measure the
they were directly involved or not. Diameter of an Object within an Image’.
[11]. R. C. Gonzalez, R. E. Woods, S. L. Eddins, “Digital Image
REFERENCES Processing using MATLAB”, ISBN 81-297-0515-X, 2005,
pp. 76-104,142-166.
[1]. Padmavathi S., Prem P., and Praveen D., ‘Locating Fabric [12]. Kenneth R. Castleman, "Digital image processing",
Defects Using Gabor Filters’, International Research Tsinghua Univ Press, 2003.
Engineering Journal of Scientific & Technology [13]. Histogram plot - MATLAB.mht
(IJSRET), Volume 2 Issue 8 pp 472-478 November 2013 [14]. https://in.mathworks.com/help/images/apply-
ISSN 2278-0882. gaussian-smoothing-filters-to-images.html
[2]. Utkarsha Singh, Teesta Moitra, Neha Dubey and Mrs [15]. http://matlab.izmiran.ru/help/toolbox/images/enhanc
M.V.Patil, ‘Automated Fabric Defect Detection Using e6.html#:~:text=To%20create%20an%20image%20hi
Matlab’, International Journal of Advanced Technology stogram,histogram%20based%20on%2064%20bins
in Engineering and Science, Volume No.03, Issue No. 06, [16]. https://in.mathworks.com/help/images/ref/medfilt2.h
June 2015, ISSN (online): 2348 – 7550. tml
[3]. R.Thilepa and M.Thanikachalam, ‘A Paper On Automatic [17]. https://in.mathworks.com/help/images/ref/regionpro
Fabrics Fault Processing Using Image Processing ps.html
Technique In Matlab’, Signal & Image Processing: An [18]. https://sisu.ut.ee/imageprocessing/book
International Journal (SIPIJ) Vol.1, No.2, December 2010. [19]. https://in.mathworks.com/help/images/linear-
[4]. Miss. Pallavi A. Patil, Dr. M. S. Kumbhar, ‘Fabric Defect filtering.html
Detection Using Image Processing Technique’ [20]. https://in.mathworks.com/help/images/image-type-
International Conference on Academic Research in conversions.html
Engineering and Management, IETE, 30 th April 2017, [21]. https://www.onlineclothingstudy.com/2019/02/classi
(ICAREM-17), ISBN: 978-93-86171-43-6. fication-of-fabric
[5]. A. Kumar and G. K. H. Pang, "Defect detection in textured defects.html#:~:text=A%20fabric%20defect%20corres
materials using Gabor filters," in IEEE Transactions on ponds%20to,faulty%20yarns%20or%20machine%20s
Industry Applications, vol. 38, no. 2, pp. 425-440, March- poils.
April 2002. doi: 10.1109/28.993164 keywords: {Gabor
filters; Inspection; Fabrics; Textile industry;
Automation; Filtering; Quality assurance; Industry
Applications Society; Consumer electronics;
Throughput},URL:http://ieeexplore.ieee.org/stamp/st
amp.jsp?tp=&arumber=993164&isnumber=21415Tan
jim Mah mud, Juel Sikder and Rana Joyti Chakma, ‘Fabric
Defect Detection System’, Research gate Conference
Paper, February 2021, DOI: 10.1007/978-3-030-68154-
8_68.
[6]. S. L. Bangare, N. B. Dhawas, V. S. Taware, S. K. Dighe, P.
S. Bagmare, ‘Fabric Fault Detection using Image
Processing Method’, International Journal of Advanced
Research in Computer and Communication Engineering
ISO 3297:2007 Certified Vol. 6, Issue 4, April 2017.
[7]. S.Priya, T. Ashok Kumar, Dr. Varghese Paul, ‘A Novel
Approach to Fabric Defect Detection Using Digital Image
Processing’, Proceedings of 2011 International
Conference on Signal Processing, Communication,
Computing and Networking Technologies (ICSCCN
2011).
[8]. Engr. Anum Khowaja, Engr. Dinar Nadir, ‘Automatic
Fabric Fault Detection Using Image Processing’, 2019
13th International Conference on Mathematics,
Actuarial Science, Computer Science and Statistics
(MACS).
[9]. Jagruti Mahure, Y.C.Kulkarni, ‘Fabrics Fault Processing
Using Image Processing Technique in MATLAB’, IJCST

© 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page 250

You might also like