Glass Defect Using SIFT
Glass Defect Using SIFT
Glass Defect Using SIFT
Sukhpreet Kaur
Assistant Professor, Department of Computer Science and Engineering
Sri Guru Granth Sahib WorldUniversity, Fatehgarh Sahib, Punjab, India
AbstractGlass defects are a major reason for poor quality and of embarrassment for manufacturers. It is
a tedious process to manually inspect very large size glasses. The manual inspection process is slow. In this paper various
glass defects and the possible automated solutions using image processing techniques for defect detection are explained .In
this paper, we are using new algorithm which is the combination of both canny edge and SIFT algorithm and new result
is produced which is better than the canny and simple SIFT.
Key Terms: - Defects; methods; processing
I. INTRODUCTION
Image is a matrix, an array or elements of picture called elements in the square form which are arranged in the form
of rows and columns. Image Processing is a process to convert an image into digital form and perform some
operations to get an enhanced image and extract useful information from it. It is a study of any algorithm that takes
an image as input and returns an image as output. Image processing is referred to processing of a 2D picture by a
computer. It is a form of signal privilege in which image is input similar to video frame or photograph and is image
or characteristics associated with that image may be output. Image processing system treat images as two
dimensional signals and set of signals processing methods are applied to them. It is latest technologies and its
applications in various aspects of a business. Image Processing forms core research area within engineering and
computer science disciplines too [21].
Image processing is used in a wide variety of applications to improve the visual appearance of images and to prepare
images for measurement. Image processing usually refers digital Image processing but optical and analog image
processing also are possible. This article is about general techniques that apply to all of them. The acquisition of
images is referred to as imaging. Image processing is also known as digital image processing.
Optical and analog image processing are also possible. There are different types of image processing fields like
computer graphics where images are created, image processing where manipulation and enhancement of images are
to be done and computer vision where analysis of images is done [17].
Image processing is also defined as the discipline in which input and output both are images. An image processing
defines a new image y in terms of the existing image x. An image can be transformed in two ways. These ways are
as follow:
1.
2.
Domain Transformation
Range Transformation
A pixel is a sample of continuous function. Modern digital technology has made it feasible to control multidimensional signals with systems ranges from simple digital circuits to
advanced parallel computers. The goal of this manipulation can be divided into three categories
Image Processing (image in -> image out)
Image Analysis
(image in -> measurements out)
Image Understanding (image in -> high-level description out)
An image may be considered to contain sub-images sometimes referred to as regions-of-interest. This concept
reflects the reality that images commonly contain collections of objects which can be the basis for a region. In a
sophisticated image processing system it should be feasible to apply specific image processing operations to regions
that are selected only. Thus one part of an image might be processed to improve color rendition and other is to be
processed to suppress motion blur.
The images should be available in digitized form is the most requirements for image processing of images, that is,
arrays of finite length binary words. For digitization, first of all the given Image is sampled on a discrete grid and
each sample or pixel is quantized using a finite number of bits. The digitized image is processed by a computer. To
display a digital image, it is first converted into analog signal, which is scanned onto a display [18].
Computer graphics and Computer vision are closely related to image processing. In computer graphics, physical
models of objects of images are manually made from the environments, and lighting, in its place of individual
acquired from natural scenes, as in most animated movies. Computer vision is often measured as high level image
processing out of which a machine/computer/software intends to decipher the physical contents of an image or a
sequence of images e.g., videos or 3D full-body magnetic resonance scans.
II. TYPES OF DEFECTS ON GLASS
Once the glass sheet is manufactured, it is sent to the defect detection division of the glass production unit for testing
and validation of defects. The various types of defects that can be present in the glass are:
a) Foreign material: This defect has the appearance of a lump. It is an unmelted, opaque material embedded
in the glass.
b) Low-Contrast Defect regions: These defect areas are roughly defined as fairly large, several millimeters
in diameter, and relatively dark and/or bright regions that stand out against the background. The dark
region compare with the light color region which compare with both the region.
c) Scratches and spots: These are the marks or irregular patches on the surface. These occur mainly during
transportation within the factory. It adds imperfections to the material which is responsible for the breakage
of the material. Scratches decrease life of the material.
d) Bubbles and inclusions: It is an air bubble like material trapped inside glass as a defect during its
production. It depends upon the gas concentration to diffuse bubble of the glass.
e) Holes and dirt: These are the surface defects which cause major problems for manufacturers, particularly
when the production process includes a surface treatment stage. Hole is also responsible for the breakage of
the glass. Sometimes a hard material struck with the glass sheet which cause a problem of holes and
decrease the lifetime of glass and make it unusable.
It is the second stage of the SIFT function. It the candidate of the main pixel into sub pixels to find out the accuracy
and remove the unstable particles or key points. It is used to improve the pixels and remove the bad pixels. It is point
descriptor like rings. In this process all the points are scans so that to improve its accuracy and remove unwanted
points. It is used to find out the points and mark them as circles. It removes the large edges.
c)Orientation Assignment:
The assigned orientation, location and scale for all key point enables SIFT to create a canonical view for the
candidate points that are invariant to similarity transforms. Its orientation depends upon the identification of the
local images patches. It removes the effect of scaling and rotation according the requirement. Here set the good
points and scale them and rotate them according the requirement we needed. Scale of point is used to find out the
good points. Using different types of differentiation find out orientations and gradient magnitude.
d)Keypoint Descriptor:
Descriptor means to mark point. In this process all the points are scans so that to improve its accuracy and remove
unwanted points. It is used to find out the points and mark them as circles. It removes the large edges. This final
stage creates the local images based upon the local image patches present in its local neighborhood. Each point has
its own value. Each particular region has different types of values.
Verbosity:
It displays the code which is used in it. It specifies the code after the generation of the result. The time value may
vary. Its value can either increase or decrease. If the value is 1 means result is producing means continuing of the
result and if value is 0 means result produced.
Threshold:
In it Grayscale is used which is less then binary. It has two types of value. If the grayscale values are greater than 1
then pixel is white and if value is less than 1 then pixel is black.
Grayscale>1 means white pixel
Grayscale<1 means black pixel
Frame is used in it. Frame means cropping the picture according to the requirement so that two images matches.
Suppose in an image we have two persons picture. We want to choose head of one person so choose one frame for
this. For the selection of second head choose second frame and so on.
V. EXPERIMENT SETUP
Following steps are followed by the SIFT.
Step 1: Read the image
Read the image using run>browse>copy address than using imread() function. , or using imreadbw() function in
which I = imreadbw(file)
IMREADBW Reads an image as gray-scale
I=IMREADBW(FILE) reads the image FILE and converts the result to a
gray scale image (with DOUBLE storage class anr range normalized in [0,1])
do this step for second image also.
If we want to read simple method used run command than after that we have converts into grayscale image.
I1=imreadbw('\data\img3.jpg') ;
I2=imreadbw('\data\img5.jpg') ;
Or
I=imread('C:\Users\Gagan\Desktop\k.JPG');
J=imread('C:\Users\Gagan\Desktop\kc.JPG');
3. Within the big square, select the pixels with the circle and put into the histogram. no need to do rotation which is
very expensive.
A frame is a sequence of samples combined into a single vector. By setting Samples per frame to 100 in the Sine
Wave block, you set the frame size to 100, so that each frame contains 100 samples.
The process of frame in which we using function h=plotsiftframe(frames,varargin)
PLOTSIFTFRAME Plot SIFT frame
H=PLOTSIFTFRAME(FRAMES) plots the SIFT frames FRAMES and returns and handle H to the resulting line
set. FRAMES has the same format used by SIFT().
Gaussian is the radial basis function most commonly used in the neural network community.In this first we initialize
the octave with S sub-levels than initialize the first sub-level than other sub-level and then convert all octave.
In this we used dogss function Local maxima extracted from the DOG have coordinates.We used extrafine function
which having an function to Refine the location, threshold strength and remove points on edges.
Step 6th
Same command run for 2nd image in which same function do their own task. To doing this we can find different
frames for image 1 and 2 in which we have to match their function with help of descriptors. Like a image having
chess board in which if they have not any kind of box than it is image which having no frames , if we divided into
row or column having same length of each box that we called or say we divided into frames.
To doing this we have an easy to catch out the object like a box divide into 50 frames now we match the second
image which having also 50 frames with same or different object. First we see in the image 1 having like 41 no
frame match with image 2 having 39 no frame , than it is easy to catch them do not match each and every object of
an image.
Similarly for 2nd image we used this command or find descriptors.
Step 7th: Matching frames and descriptor:
Now match them all the frames or descriptors which u find them inside the image, in this we pass the int value to
enhance the matching speed.
The basics syntax of match function num = do_match(im1, des1, loc1, im2, des2, loc2) in which it keep matches in
which the ratio of vector angles from the nearest to second nearest neighbor is less than distRatio.
In the matching process:
1. For each descriptor in the first image, select its match to second image.
2. Check if nearest neighbor has angle less than distRatio times 2nd
3. Check each matching point, eliminate false matches by voting from neighboring area
4. Compute the corresponding distances of the matching points in image 2
5. Normalize the distance and orein_diff vector
6. Create a new image showing the two images side by side.
7. Show figure
To doing match we used uint8 function, like in your process its not working , either you have to change into double
or cannot used these two function , you can directly run this one command without using uint8 function. After first
work done in which you have to find points where match done with another image now you want compress that
image using PCA method.
In our work we have different types of images of glass in which defects are find out using SIFT algorithm because
this algorithm is find out more accurate result as compare to other algorithms. It is less time consuming process. By
following all the above method two images are compare and their defects can be find out easily and mark them as a
lines or circle so that the defects can be easily find out. Here we have suppose two types of image first read the
image using read function. Now rotate both the images according to the requirement in the second function. After
doing this resize the image because every image have not same size like one image having 10 kb and another one
have 13.23 kb so we have to give both image constant value or same value using function.
After this one we have to give min or max value of image which we have to resize in the previous step using
function:
Image_name=Image_name-min(Image_name(:)) ;
Image_name=Image_name/max(Image_name(:)) ;
Doing this step or using this function it declare that if one image having 256 rows 406 columns or second image
having 200 rows and 389 columns than it give the min value that is appropriate for both image in rows and columns.
In the next step Gaussian functions are applied like descriptor, verbosity etc. In second last step we have to frame
the images which we want remove rest of all. In final step, we have matching the descriptor and lines or circle are
formed which indicate the defect on glass sheet.
In this paper we used new algorithm which is the combination of both canny edge and SIFT algorithm and new
result is produced which is better than the canny and simple SIFT both. From till date SIFT is used to find object of
similar types but with new algorithm we have to find out the defection and defects of different images also which
are more efficient than other existing algorithms.
VI. RESULTS AND DISCUSSION
Image Processing Toolbox is included in MATLAB and Simulink Student Version. Its key features as follows:
Analyzing Images
Now we combine above glass image with other image and find out defects from these glass images. With the help of
matching descriptors defects can be easily find out.
After combining both the images SIFT algorithm is applied on them. SIFT algorithm here is used to identify the
defects in glass images. Both images are of different types. This proves that our algorithm can be used to find out
defects in different glass images which is not possible in existing SIFT algorithm.
Fig 4.3: shows the glass detection of two different images and their matching using SIFT
Here we have two different images. First we have to follow all the step of SIFT algorithm. We have to adjust the
size and height of the images also that all the defects can be easily find out. First of all we have to adjust the size of
the image so that defects can be easily found out and matching key points easily.
In the above figure the lines which are drawn from one image to other. These lines are indicate the matching of
defect of one image to the defects of other image using matching function of the SIFT algorithm.
.
Fig.4.5: shows two similar images merge them which indicating same types of defect at both sides.
In the above figure we have two images which are of similar types. By resizing them, cropping, framing we can say
that by using SIFT function properties two images are combined to find out defection from both the images.
Here as we know similar images of glass or glass sheets are available so that defects at both the images are also
same. At both the images defects are same which are matched by using matching functions.
Fig.4.7: shows the defection at glass images at both sides similar defects
Defects can be easily found out by comparing two images at both the sides as shown in the above figure. We
combined similar images here. We have two images of similar types both are identical so defects which are present
in both images also similar. By using SIFT functions images are adjusted and defects are found out. At the end these
defects are shown with the help of green lines using matching function which are now easily visible as compared to
circles or any other types of marks.
Fig. 4.9: shows defects at the two similar images and matching defects indicate with lines
We have similar types of images as shown in figure 4.3, here first of all following the initial steps of SIFT functions
i.e. resizing, scaling, find out local descriptor etc. After using these steps find out defects at both the images. Now
with the scale space and orientation and matching functions match the defects of both the images so that these
defects can be easily recognized with naked eyes. Green lines are indicating the defection matching of one image to
other image.
REFERENCES
[1]
Tribhuwan Singh, Rajeshwar Lal Dua, Sunil Agrawal and Abhishek Acharya (2013), Detection of Defects in Glass Sheet using C.S.C
based Segmentation Method,International Journal of Computer Applications ,Published by Foundation of Computer Science, New York,
USA, 2013,pp 29-32.
Kazuki Maeno, Hajime Nagahara, Atsushi Shimada, and Rin-ichiro Taniguchi (2013) Light Field Distortion Feature for Transparent
Object Recognition,Computer vision foundation,IEEE explore,2013,pp 2786-2793
B. suvdaa, J. ahn and J. ko (2012), steel surface defects detection and classification using sift and voting strategy, International journal of
software engineering and its applications ,vol. 6, no. 2, 2012,pp.161-165
Nishu, Sunil Agrawal (2012), Glass Defect Detection Techniques using Digital Image Processing A Review IP Multimedia
Communications A Special Issue from IJCA www.ijcaonline.org,2012,pp.65-67
Jie Zhao, Xu Zhao and Yuncai Liu (2011), A Method for Detection and Classification of Glass Defects in Low Resolution Images, Sixth
International Conference on Image and Graphics, 2011, pp.642-647.
[2]
[3]
[4]
[5]
[6]
Luo Juan and Oubong Gwun (2009), A Comparison of SIFT, PCA-SIFT and SURF, International Journal of Image Processing (IJIP)
Volume(3), Issue(4),2009,pp. 143-152
F. Adamo, F. Attivissimo, A. Di Nisio and M. Savino (2008), An Automated visual inspection system for the glass industry,In: Proc. of
16th IMEKO TC4 Symposium, Florence, Italy, Sept. 2224, 2008.
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
[22]
[23]
[24]
Krystian Mikolajczyk and Cordelia Schmid (2005), A performance evaluation of local descriptors, Pattern Analysis and Machine
Intelligence, IEEE Transactions on Pattern Analysis and Machine Intelligence ,Volume 27 , Issue 10 ,2005, pp 1615 1630.
Yan K and Rahul Sukthankar (2004) , Pca-sift: a more distinctive representation for local image descriptors Computer Vision and Pattern
Recognition, IEEE Computer Society Conference on ,2004 pp.506-513.
Gajanand Gupta (2011), Improved Median Filter and Comparison of Mean, Median and Improved Median Filter International Journal
of Soft Computing and Engineering (IJSCE) SSN: 2231-2307, Volume-1, Issue-5, November 2011 Algorithm for Image Processing Using
Matlab
Harshlata Vishwakarm1,S.K.Katiyar (2012), comparative study of edge detection algorithms on the remote sensing images using matlab
International Journal of Advances in Engineering Research http://www.ijaer.com/ (IJAER) 2011, Vol. No. 2, Issue No. VI, December
ISSN: 2231-5152 [5] IJCEM International Journal of Computational Engineering & Management, Vol. 15 Issue 1, January 2012 ISSN
(Online): 2230-7893 www.IJCEM.org Image Restoration Using Filling-In Technique
Priyanka, Rajesh Gulhane and V.T.Gaikwad (2012), International Journal of Advanced Research in computer science and software
engineering,vol 2,Issue 1
JOURNAL OF COMPUTERS, VOL. 7, NO. 4, APRIL 2012 Application of Improved Median Filter on Image Processing Rong Zhu
School Of Computer Science, Qufu Normal University, Rizhao, Shandong 276826, China zhurongsd@126.com
Nasrul Humaimi Mahmood, Noraishikin Zulkarnain, Nor Saradatul Akmar Zulkifli(2012) International Journal of Engineering Research
and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 3, May-Jun 2012, pp.691-694
R. Yusnita, Fariza Norbaya, and Norazwinawati Basharuddin (2012), Intelligent Parking Space Detection System Based on Image
Processing International Journal of Innovation, Management and Technology, Vol. 3, No. 3, June 2012
http://www.sprawls.org/resources/DICHAR/module.htm1
http://engineering.rowan.edu/~shreek/fall09/dip/
Algorithm of image analysis, A crash course on Image Processing Basics
Acknowledgements: slides from Steven Seitz, Aleosha
Efros, David Forsyth, and Gonzalez & Woods
http://www.eng.tau.ac.il/~yaro/lectnotes/pdf/LI_Images&ImagingDevices_B.pdf
Image processing application-An overview, CYH/Image Fundamentals/p.16
Jie Zhao, Xu Zhao and Yuncai Liu (2011), A Method for Detection and Classification of Glass Defects in Low Resolution Images, Sixth
International Conference on Image and Graphics, 2011, pp.642-647
http.en.wikipedia/wiki
Sumeet Singh Tiwana, Sukhpreet Kaur (2013), International Journal of Computer Science and Mobile Computing, IJCSMC, Vol. 2, Issue.
5, May 2013, pg.82 85
Yan Ke, Rahul Sukthankar, PCA-SIFT: A More Distinctive Representation for Local Image DescriptorsAvailable at
http://www.cs.cmu.edu/yke/pcasift/