APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. ·...

45
APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF WELDING PRACTICAL RESEARCH IN MATLAB Spring 2012: MAGI09 Master’s (one year) thesis in Informatics (15 credits) Jiannan Shen

Transcript of APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. ·...

Page 1: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

APPLICATION OF IMAGE

SEGMENTATION IN INSPECTION OF WELDING

–PRACTICAL RESEARCH IN MATLAB

Spring 2012: MAGI09

Master’s (one year) thesis in Informatics (15 credits)

Jiannan Shen

Page 2: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

II

Title: < Application of image segmentation in inspection of welding – Practical

research in MATLAB >

Year: 2012

Author/s: <Jiannan Shen>

Supervisor: < Tuve Löfström>

Abstract As one of main methods in modern steel production, welding plays a very important

role in our national economy, which has been widely applied in many fields such as

aviation, petroleum, chemicals, electricity, railways and so on. The craft of welding

can be improved in terms of welding tools, welding technology and welding

inspection. However, so far welding inspection has been a very complicated problem.

Therefore, it is very important to effectively detect internal welding defects in the

welded-structure part and it is worth to furtherly studying and researching.

In this paper, the main task is research about the application of image segmentation in

welding inspection. It is introduced that the image enhancement techniques and image

segmentation techniques including image conversion, noise removal as well as

threshold, clustering, edge detection and region extraction. Based on the MATLAB

platform, it focuses on the application of image segmentation in ray detection of

steeled-structure, found out the application situation of three different image

segmentation method such as threshold, clustering and edge detection.

Application of image segmentation is more competitive than image enhancement

because that:

1. Gray-scale based FCM clustering of image segmentation performs well, which

can exposure pixels in terms of grey value level so as that it can show hierarchical

position of related defects by grey value.

2. Canny detection speeds also fast and performs well, that gives enough detail

information around edges and defects with smooth lines.

3. Image enhancement only could improve image quality including clarity and

contrast, which can’t give other helpful information to detect welding defects.

This paper comes from the actual needs of the industrial work and it proves to be

practical at some extent. Moreover, it also demonstrates the next improvement

direction including identification of welding defects based on the neural networks,

and improved clustering algorithm based on the genetic ideas.

Keywords: image segmentation, threshold, clustering

Page 3: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

III

Table of Contents

1 INTRODUCTION .................................................................................................................... 1

1.1 BACKGROUND ............................................................................................................................. 1 1.2 RESEARCH PURPOSE AND RESEARCH QUESTION .......................................................................... 3 1.3 STRUCTURE ................................................................................................................................. 4

2 RESEARCH DESIGN.............................................................................................................. 5

2.1 RESEARCH PERSPECTIVE AND STRATEGY .................................................................................... 5 2.1.1 Research perspective .................................................................................................... 5 2.1.2 Research strategy .......................................................................................................... 5

2.2 INTEREST GROUPS ....................................................................................................................... 5 2.2.1 Interest group in welding industry ................................................................................ 5 2.2.2 Interest group in academia ........................................................................................... 6

2.3 FORMULATION OF OBJECTIVES .................................................................................................... 6 2.4 LITERATURE REVIEW ................................................................................................................... 6 2.5 METHOD OF DATA GATHERING .................................................................................................... 9 2.6 METHOD OF DATA ANALYSIS..................................................................................................... 10 2.7 METHOD OF DATA INTERPRETATION ......................................................................................... 10 2.8 EVALUATION STRATEGY ........................................................................................................... 12

2.8.1 Validity ....................................................................................................................... 12 2.8.2 Reliability ................................................................................................................... 12 2.8.3 Generalizability .......................................................................................................... 12

3 THEORY FRAMEWORK .................................................................................................... 13

3.1 ALGORITHMS OF IMAGE SEGMENTATION ................................................................................... 13 3.1.1 Thresholding............................................................................................................... 13 3.1.2 Clustering ................................................................................................................... 13 3.1.3 Edge detection ............................................................................................................ 14

3.2 ALGORITHMS OF IMAGE ENHANCEMENT ................................................................................... 16 3.2.1 Linear transformation ................................................................................................. 16 3.2.2 Denoising ................................................................................................................... 16 3.2.3 Histogram equalization............................................................................................... 16

4 MAIN WORK ......................................................................................................................... 16

4.1 EXPERIMENT 1: APPLICATION OF IMAGE SEGMENTATION ......................................................... 19 4.1.1 Thresholding............................................................................................................... 19 4.1.2 Clustering ................................................................................................................... 20 4.1.3 Edge detection ............................................................................................................ 23 4.1.4 Solution of image segmentation in welding detection ................................................ 23

4.2 EXPERIMENT 2: APPLICATION OF IMAGE ENHANCEMENT .......................................................... 25 4.2.1 Solution of image enhancement ................................................................................. 25 4.2.2 Solution verification between image segmentation and image enhancement ............. 26

5 CONCLUSION ....................................................................................................................... 27

5.1 APPLICATION OF IMAGE SEGMENTATION ................................................................................... 27 5.2 EVALUATION STRATEGY DISCUSSION ........................................................................................ 28 5.3 DISCUSSION AND KNOWLEDGE CONTRIBUTION ......................................................................... 30 5.4 FUTURE RESEARCH .................................................................................................................... 31

5.4.1 Fuzzy c-means clustering easily plunges in local optimum because of inappropriate

initial value. .............................................................................................................................. 31 5.4.2 Image segmentation can’t do defect recognition in welding detection. ...................... 32

6 REFERENCE: ........................................................................................................................ 35

7 APPENDIX ............................................................................................................................. 37

Page 4: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[1]

1 Introduction

1.1 Background

As one of information technologies, Image processing is the process of modifying or

interpreting existing pictures, such as photographs. (Hearn & Baker, 1997). It originates

from newspaper industry in 1920s, which is applied in “Bartlane cable picture

transmission system”. It contains image segmentation, image enhancement, image

recognition and so on. Three layers of image processing technology are:

1. Low-level processing: inputs and outputs are images

2. Mid -level processing: inputs are images and outputs are attributes

3. High -level processing: “making sense” , performing cognitive functions

Nowadays, image processing technology shows more and more power in many fields

such as medical, industrial and commercial areas. In recent years, image processing

technology is widely used in medical science to help understand and gather information

from biomedical images of nature of human biological systems. Transformation from

2D to 3D images, automated feature finding and mage comparison is the magnificent

outcomes of the image processing technology. Moreover, image processing is also

applied in textile industry to detect yarn parameters, the roughness of textile surface

and the defect of textile, which is proved to be very effective.

To be most important, many improved theories, algorithms and models of image

processing technology are proposed and inspired based on actual application research

such as “Omron's new ZFX-C Smart Vision Sensor”. It proves to that application

research of image processing technology contributes not only to help understand and

gather information from the images but also to self-develop really in theories,

algorithms and models.

So far, taking on the inspection of welding, there is not any application research and

knowledge of image processing technology. As one of the main methods in modern

steel production, welding plays an important role in the economy. Welding has been

widely applied in many fields of aviation, petroleum, chemicals, electricity, railways

and so on.

The craft of welding can be improved from the aspects of welding tools, welding

technique and welding inspection. So far, welding inspection has been a very complex

issue because a variety of defects will be produced in the welding process. Welded

structural parts which usually stand a high temperature, high pressure, corrosion and

other extreme environments lead to performance deterioration, affect the safe

operation and even endanger the industrial production. Therefore, it originates my

research interest for it is very important to effectively detect internal welding defects

of the steeled-structure.

The general construction work is connected by components such as steel and steel

plate structure. Constituting the entire structure by components, it ensures safe and

reliable, clear power transmission, simple installation and save steel. So, the

connections among different components are divided into welding connection, rivet

connection and bolted connection.

Page 5: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[2]

a) welding connection b) rivet connection c) bolted connection

Figure 1.1 The structure of the steel structure

As the most important connection of modern steel structure, welding connection has

the following main advantages:

1. Simple structure: can be directly connected with components in any forms

2. Economic use of materials with no weakness of cross-section

3. Automated operation and high quality

4. Closed connection and rigid structure

The welding connection of steeled-structure is shown in Figure 1.2, it is categorized

into four types such as docking, lap joint, T-type joint and corner joint.

Figure 1.2 Welding connection of steeled-structure

The docking is mainly used for connecting between two components with similar

thickness. It is outstanding in flat power transmission and no significant stress

concentration. But it is poorly structured at the edge of the welding-part, which is to

be processed further.

Lap joint is suitable to connect components with different thickness. It shows uneven

power transmission and more material expense, but it is easy to construct.

T-type joint connection is used to save materials and suitable for composite section.

Corner joint is commonly used in unimportant structures because of poor stress

condition.

Defects of the steeled-structure welding inspection are divided into two categories:

1. External defects

In the surface of welding, it can be seen with the naked eye or low times magnifying

glass such as undercut, welding tumor, craters, surface pores and cracks.

2. Internal defects

In the internal part of welding, it can be found through a variety of nondestructive

testing methods or destructive testing such as incomplete penetration, incomplete

fusion, slag inclusions, pores and cracks.

a) docking b) lap joint c) T-type joint d) corner joint

Page 6: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[3]

As a nondestructive testing method, ultrasonic testing uses probes to send out

ultrasonic, frequency more than 20 kHz, and take advantage of the reflection and

diffraction of ultrasound when encountered defects. Ultrasonic testing has the features

as strong penetration, accurately measure and location of small defects. Ultrasonic

testing is one of the nondestructive testing methods most widely used in the detection

of welding defects.

Ray testing use ray absorption and attenuation of material defects and on destructive

location to reflect on the different levels of photoreceptor ray film to determine the

size and number of defects and other information. Ray absorption rate largely depends

on the density of the material. Therefore, ray testing is effective to detect the welding

pores, slag inclusions, incomplete fusion and incomplete penetration defects.

However, photoreceptor ray film can not only qualitatively display defects but also

measure the defect size for permanent preservation.

1.2 Research purpose and research question

First of all, the harmfulness of welding defects in the steeled-structure is shown in the

following aspects:

1. Reducing welding carrying cross-sectional area and weaken the static tensile

strength due to the presence of defects.

2. Occurring stress concentration and embrittlement in tip of gap leading to cracks

and expanding due to gap of defects.

3. Penetrate the welding leak and affect the compactness due to the defects.

Collectively, hazard in these details will cause a large extent impact and even harm

the entire construction project. It is necessary to have the high quality photoreceptor

ray film to analyze on, which can give the accurate location, size and sharp of the

welding defects. The main purpose of the paper is to research on the application of

image segmentation in photoreceptor ray film of the ray inspection of welding.

Therefore, the relative research questions should be proposed firstly before the

research working. Based on the main purpose of the paper, the main question is asked

as followed:

Main question: Is image segmentation suitable to apply on photoreceptor ray film for

ray inspection of welding?

To answer the main question, some sub questions should be answered in advance.

Generally speaking, we must know more about the research situation of the ray

inspection of welding and application situation of the image segmentation.

Sub question1: What is the current research situation of the ray inspection of welding?

It is helpful for main question to look for difficulties of current ray inspection of

welding in which image segmentation is expected to improve.

Sub question2: What is the current research situation of the image segmentation such

as application situation, research history and so on?

Page 7: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[4]

To answer the main question, it is necessary to learn the concrete theory of image

segmentation which is proposed to research in the paper. The expected outcome from

this sub question is the review of different approaches of image segmentation from

the literature. Furthermore, our proposed method of applicating image segmentation

on photoreceptor ray film for ray inspection of welding will be formulated based on

the reviewed approaches.

Sub question3: How can we research on the application of image segmentation in

photoreceptor ray film of the ray inspection of welding?

It contributes to design our research method based on main question. The expected

result from this sub question is detail description of our research method such as

method of data collection, method of data analysis and so on.

Sub question4: Could a solution for ray inspection of welding be proposed based on

current theory within the field?

It is hopeful to propose solutions according to current theory within the field. The

expected result from this sub question is the concrete statement of algorithm solution.

Obviously, it requires the practical experiments on the feasible and performance

analysis because in terms of performance analysis, we can verify our proposed

solution if it is suitable or not.

Sub question5: How does our proposed solution for applying image segmentation

perform in practical experiments?

It tries to find out our appropriate solution applied in in ray inspection of welding

based on proposed application solution. The expected outcome is practical

experiments on the feasible and performance analysis for helping to conclude

application situation of image segmentation.

All in all, after trying to answer these sub questions, the main question can be

answered totally. The next several sections are to try to find the answers of these sub

questions.

1.3 Structure

The logical research structure of the paper is in terms of how to do, then what to do

and what’s practical performance. So, it is divided into several sections and in each

section the research questions is tried to answer step by step.

2. Research design

In this section, design two kinds of research method based on my topic, one is case

study and the other is comparative study. So in this chapter, these two methods will be

introduced in detail to show how to research the topic.

3. Theory framework

In this section, many related theories and algorithm will be introduced in detail such

as threshold, clustering and edge detection in image segmentation and linear

transform, histogram equalization and filtering in image enhancement.

Page 8: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[5]

4. Main work

In this section, we try to propose our proposed solution to solve the difficulty of in ray

inspection of welding. We do the practical experiments on the feasible and

performance analysis of proposed solution and find out the appropriate solution on ray

welding detection.

5. Conclusions

In this section, the application conclusions will be discussed on the comparative

analysis between application of image segmentation and the other similar one,

application of image enhancement, which are all based on MATLAB platform.

Moreover, if the questions can’t be answered in the paper, the further research

direction will also be given to improve.

2 Research design

2.1 Research perspective and strategy

2.1.1 Research perspective

When coming to the research designs there are two designs that we can talk about and

they are Qualitative and Quantitative. Qualitative Design gathers the data from

different respondents but it is not analyzed as such. Quantitative gives the systematic

empirical investigation of the quantitative properties.

Our research gives the systematic empirical investigation of the quantitative

properties during application of image segmentation in welding inspection.

Positivistic perspective explains the proportions between two things and is expressed

in numeric terms whereas hermeneutic perspective is a kind of explanation of the

theory of understanding.

As the research is quantitative, positivistic perspective is appropriate to explain the

proportions between two things and is expressed in numeric terms such as image

parameters of image segmentation.

2.1.2 Research strategy

Descriptive research aims to describe the data, statistics that are studied. Explanatory

research gives a better understanding of the information that is gathered and studied

and also leaves a scope for us to develop on the topic in future.

Our thesis work is being done describe the data, statistics during experiments research

of application of image segmentation so we shall take up descriptive research for a

better understanding of the topic and in depth analysis.

2.2 Interest groups

2.2.1 Interest group in welding industry

Main interest group is the practitioners of the welding industry. They might

understand the application combination between image segmentation and welding

inspection so as to smooth their work efficiency and the quality of defects recognition.

Page 9: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[6]

2.2.2 Interest group in academia

Our interest group in academia might be academics studying with image segmentation

of computer science. They might keep further research on image segmentation such as

in the fields of theory, algorithms and segmentation tools.

Sub question 3 that “How can we research on the application of image segmentation

in photoreceptor-ray film of the ray inspection of welding?” is hopefully be answered

in following sections.

2.3 Formulation of objectives

The objectives are set out to attain the research study. Based on the research questions

which have been proposed, there are the following objectives:

1. To find out the appropriate algorithms of image segmentation applied in welding

detection.

2. To compare several classic algorithms of image segmentation applied in welding

detection.

3. To demonstrate application of image segmentation will be superior to the

application of image enhancement.

The first objective we can get the answer in the descriptive study and the other two

objectives should be explored in the experiment studies.

2.4 Literature review

Sub question 1 “What is the current research situation of the ray inspection of

welding?” and sub question 2 “What is the current research situation of the image

segmentation such as application situation, research history and so on?” are hopefully

be answered in this 2.2 section through the method of reviewing the previous and

current classic literature.

Current research situation of welding ray detection

Mr. Wan (2008) reviews and analyzes the X-ray detection principle. In addition, the

design scheme of the system and the X-ray receiving system are both emphasized on.

Then the image processing algorithms including normalization, grey enhancement and

image reversion algorithm are listed and discussed. It is found that the nondestructive

detection system based on X-ray could be widely applied in mines, ports and

terminals, grocery check, thickness measure, wire ropes conveyer belt and customs

inspection. It can prevent the occurrence of serious safety accident, equipment

damage, casualties, transport material losses and economic damage, and improve the

production efficiency. The system has high economic and social benefits.

Mr.Sun et al (2005) demonstrate that the difficulties during ray detection of welding

defects are:

Small brightness of photoreceptor ray film

Gray-focus, low contrast of photoreceptor ray film

Photoreceptor ray film with blur edge

Big image noise of photoreceptor ray film

Page 10: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[7]

The authors develop a real-time imaging and detecting system to settle above problem.

The automatic X-ray weld seam detection system recommended in this article applies

defect detection algorithm based on fuzzy rules to identify defects in welded seam. It

can give a very high confidence about the defect.

Shirai (1969) introduces an algorithm for automatic inspection of X-ray photographs.

Without any treatment for taking X-ray photographs, the new algorithm is very

applicable to non-automatic welding, which consists of two steps. The first is to

extract parameters of welding and the second is to determine the boundaries of the

welding part. The results of experiments with an X-ray photograph of the butt weld of

a boiler on the HITAC 5020E is satisfactory.

Alaknanda et al (2006) pay more attentions on how to find the type of flaw and its

causative factors. They propose the morphological image processing on radiographic

weld images. It means that the image is dilated first and then eroding is performed.

The Canny operator is applied to determine the flaw boundaries before choosing an

appropriate threshold value. Flaws characterized in segmented images can be

categorized in different types like lack of fusion, incomplete penetration, slag line,

slag inclusion, cracks, undercuts, porosity and wormholes.

Amir and Zaccone (1996) review the inspection requirements and overall methods.

These procedures were applied to the inspection of the diverter panels on an advanced

missile fuel tank. The diverter welds contain double fillet welds, with both obtuse and

acute angles, which were difficult to inspect for penetration at the roots of the welds.

The remainder of the weld contains single obtuse fillet welds which are inspectable by

X-ray. With extra exposures and setups the obtuse angle weld of the double fillet weld

can be inspected by X-ray.

In summary, it is found out the difficulties of current ray inspection of welding in

which image segmentation is expected to improve, which is small brightness, gray-

focus and low contrast, big image noise and blur edge of photoreceptor ray film.

Current research situation of image segmentation

Fut and Mui (1981) devote to research on the survey on current image segmentation.

They contribute to categorize many image segmentation techniques into three classes:

1. Characteristic feature thresholding or clustering

Thresholding method is based on a cliplevel (or a threshold value) to turn a gray-scale

image into a binary image (Pham Dzung L. 2000).Clustering is a process of

organizing the objects into groups based on its attributes (Thilagamani & Shanthi

2011).

2. Edge detection

Edge detection is a well-developed field on its own within image processing. Region

boundaries and edges are closely related, since there is often a sharp adjustment in

intensity at the region boundaries (Pham Dzung L. 2000).

3. Region extraction

Region extraction takes a set of seeds as input along with the image. The seeds mark

each of the objects to be segmented. The regions are iteratively grown by comparing

all unallocated neighboring pixels to the regions (Pham Dzung L. 2000).

Page 11: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[8]

Throughout the research work, it is found that image segmentation techniques are

strongly application dependent. For instance, edge detection should be considered

when chest X-ray image segmentation whereas thresholding and clustering could be

widely used in cell image segmentation because each image segmentation technique

is adapted to the application features.

Bardera et al (2009) pay more attentions on the use of excess entropy to locate the

optimal thresholds in image segmentation. The most important problem is to choose

optimal thresholds. Based on the conjecture, their contributions are outstanding in as

followed. First, they introduce the excess entropy as the measure of structural

information of an image. Second, they propose the adaptive thresholding model by

use of excess entropy, which is the process loop of locating optimal thresholds. The

experimental results have shown good performance and behavior.

Sathya and Manavalan (2011) make the great efforts in clustering methods research in

image segmentation. Generally speaking, they do the main work in FCM, which is the

short name for fuzzy C-means clustering, and K-means clustering algorithms as well

as improved algorithms of these two kind of clustering methods. FCM clustering is a

method of clustering which allows one piece of data to belong to two or more clusters

(Mario et al 2006). The procedure of K-means clustering follows a simple and easy

way to classify a given dataset through a certain number of clusters (assume k clusters)

fixed a priori (Bradley & Fayyad 1998). The classic experiments are done on the

platform of MATLAB, which is in order to analyze on the performance of each

algorithm. Therefore, it is evaluated from many different measurements which depict

the quality of the image segmentation. In the conclusion, the authors regard improved

FCM algorithm could perform better than others in terms of performance accuracy.

Mr. Jiang and Mr. Zhou (2004) successfully propose an image segmentation method

based on ensemble of SOM neural networks, which is regarded the research frontier

in this field. It is new in clustering the pixels in image according to color and spatial

features with the SOM neural networks. Experimental results show its better feasible

than K-means or single SOM neural network, but it has drawback in manually setting

the number of regions to be segmented.

The problem of image evaluation for image segmentation must be included which we

should consider. It could give performance analysis of the segmented images. Mr.

Zhang (1996) emphasizes on the research of evaluation methods for image

segmentation. In the paper, the author proposes that most evaluation methods for

image segmentation should be divided into three groups: the analytical, the empirical

goodness and the empirical discrepancy groups. Obviously, each group of course has

its own characteristics and limitations, which is discussed from generality for

evaluation, complexity for evaluation as well as qualitative versus quantitative and

subjective versus objective. The author gives the conclusion that the empirical

methods are more suitable and useful than analytical methods for performance

evaluation of segmentation algorithms. It is realized that how to form a set of

performance measures should be very important in the future.

Current application situation of image segmentation

Ahmed et al (2012) devote themselves in medical image segmentation application,

especially in liver CT image segmentation. In the paper, they summarize the liver

Page 12: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[9]

segmentation methods and techniques using CT images, which are divided into two

main classes: semiautomatic and fully automatic methods. Several methods are

experimented during the working including gray level based techniques, learning

techniques and model fitting techniques, etc. In conclusions, gray level based

techniques get the most promising performance results but also have the drawback of

no consideration of the high variability of CT intensity values.

Remus and Zeno (2010) have researched in satellite image segmentation. They

contribute to propose a method for satellite infrared image segmentation. By

comparison with previously introduced Ahuja transform, it is found that the forces

convergence points forms median lines of uniform regions. Therefore, combining the

features provided by Ahuja transform with an adapted segmentation method, the

successful region extraction is performed better than others. By means of periodical

calibration data provided by Meteosat, they have found that the homogeneity factor of

what can be established, simplifying the transform application.

In summary, by reviewing related research literature, we have found that

segmentation algorithms of thesholding, clustering and edge detection could be

applied in welding detection. In addition, it is also important to evaluate segmentation

quality. The segmentation evaluation method can be divided into subjective and

objective ways, which can be considered in our main work.

In summary, image segmentation method is mainly classified in thretholding,

clustering and edge detection. Moreover, there is other method integrated with

different theory such as integrated SOM neural networks. It is integrated to settle the

unique problem so that these integrated methods are unrepresentative and irrelevant

with our topic. Throughout the research work, it is found that image segmentation

techniques are strongly application dependent. Therefore, thretholding, clustering and

edge detection are chosen to do the further application research.

2.5 Method of data gathering

Sub question 3 that “How can we research on the application of image segmentation

in photoreceptor ray film of the ray inspection of welding?” is hopefully be answered

in 2.3 and 2.4 section.

First of all, quantitative approach is chosen in the paper to do experimental study.

Determine the variables by sample design.

The population: Actual images of welding detection for 2004 in Sinopec Pipeline

Storage and Transportation Company.

Type of sample: Stratified random sample. The population is mainly classified

according to the category of welding defects.

The sample size: Select 6 images from each group including incomplete penetration,

incomplete fusion, pores and cracks.

The images of welding detection used in the paper are the secondary data from the

Sinopec Pipeline Storage and Transportation Company. The images of welding

detection come from their actual photoreceptor ray film and have been digitized by

image processing.

Page 13: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[10]

Using the equipment of CCD cameras and photomultiplier tubes, the images of

welding detection is converted to digital images on the same standard level:

Format: JPG

Compression: Compressed for speed of access

Spatial resolution: Resize images to 640 pixels in their longest dimension (either

width or height), 96 dpi

Tonal depth: gray-scale

2.6 Method of data analysis

In the paper, the images are analyzed in quantitative way using the computer, with the

platform of MATLAB.

Image processing toolbox™ in MATLAB provides a comprehensive set of reference

standard algorithms and graphical tools for image processing, analysis, visualization,

and algorithm development. It can perform image enhancement, image deblurring,

feature detection, noise reduction, image segmentation, geometric transformations,

and image registration.

Experiment 1: Application of Image Segmentation

Apply thresholding, clustering and edge detection to segment 4 groups of sampling

variable images based on image processing toolbox™ in MATLAB. Seen in the Table

2.1, different algorithms will be experimented based on different segmentation

methods.

No. Method Algorithms

1 Thresholding Otsu’ method, Histogram thresholding

2 Clustering K-means, Fuzzy C-means

3 Edge detection Roberts, Sobel, Prewitt, Canny

Table 2.1 Method and algorithms

2.7 Method of data interpretation

Experiment 1: Application of Image Segmentation

1. First of all, the segmentation quality of different algorithms in the same method

will be evaluated in subjective way. Mean Opinion Score (MOS), according to the

indexes including clarity, contrast, contour of the image and convenience.

MOS gives a numerical indication of the perceived quality of the media received after

being transmitted and eventually compressed using codes. MOS is expressed in one

number, from 1 to 5, 1 being the worst and 5 the best. MOS is quite subjective, as it is

based figures that result from what is perceived by people during tests.

We would ask for some persons to evaluate on the experiment based on MOS. So we

consider the questions about “who are they” and “how to choose them”. They should

have the following characteristics:

Have background knowledge of ray detection.

Research on image processing and image segmentation.

Page 14: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[11]

Secondly, we choose them according to following rules:

Representative

Authoritative

Simple executive way

When choosing the representative algorithm to compare with each other, we score

every test and calculate the mean score of each method according to Table 2.2.

Index Good(5) General(3) Bad(1)

Clarity

Contrast

Contour

Convenience

Amount Score

Table 2.2 Subjective evaluation framework of the image

2. As a result, representative algorithm is chosen to compare with each other in

objective way. The objective quality indexes are given as followed (C.Sasi et al

2011):

Mean Squared Error (MSE)

It is one of many ways to quantify the difference between values implied by an

estimator and the true values of the quantity being estimated.

Signal to Noise Ratio (SNR)

It is a measure used in science and engineering that compares the level of a desired

signal to the level of background noise.

Peak Signal to Noise Ratio (PSNR)

The PSNR is evaluated in decibels and is inversely proportional the Mean Squared

Error.

Mean absolute error (MAE)

MAE is average of absolute difference between the reference signal and test image.

By comparison of these image quality indexes, we can evaluate the segmentation

quality and find out the application solution.

The interpret rules are based on:

MSE and MAE: the smaller, the better.

SNR and PSNR: the larger, the better.

Experiment 2: Application of Image Enhancement

Apply linear transformation, denoising and image equalization algorithms to enhance

4 groups of sampling variable images based on image processing toolbox™ in

MATLAB.

As a result, the results of Experiment 1 are compared with the result of image

enhancement according to objective quality indexes given in above. By comparison of

Page 15: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[12]

these image quality indexes, we can verify if image segmentation will be superior to

the application of image enhancement.

2.8 Evaluation strategy

2.8.1 Validity

Validity is to answer whether the research measured what it intended to.

Internal validation addresses how valid it is to make causal inferences about the

intervention in the study. It will be evaluated by answering the following questions:

Is the research design sufficiently rigorous?

Have alternative explanations been considered? Have the findings really been

accurately interpreted?

External validation addresses how generalizable the study’s inferences are to the

general population. It will be evaluated by answering the following questions:

Can the results of the study be transferred to other situations?

Have other events intervened which might impact on the study?

2.8.2 Reliability

Reliability is the extent to which a measure will produce consistent results.

Test-retest reliability checks how similar the results are if the research is repeated

under similar circumstances. Stability over repeated measures is assessed with the

Pearson coefficient.

Alternative forms reliability checks how similar the results are if the research is

repeated using different forms.

Internal consistency reliability checks how well the individual measures included in

the research are converted into a composite measure.

2.8.3 Generalizability

Generalizability is the ability to make inferences from a sample to the population. It

will be evaluated by answering the following questions:

Are the findings applicable in other research settings?

Can a theory be developed that can apply to other populations?

Level Low High

Validity Internal validation

External validation

Reliability

Test-retest reliability

Alternative forms reliability

Internal consistency reliability

Generalizability

Table 2.3 Evaluation on the research process

When we evaluate the analysis method in experimental research, it can be answer

based on the Table 2.3 to check the level of validity, reliability and generalizability,

which is necessary to assure the quality of the research outcomes.

Page 16: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[13]

3 Theory framework Sub question 4 “Could a solution for ray inspection of welding be proposed based on

current theory within the field?” could be answered in this section.

3.1 Algorithms of image segmentation

3.1.1 Thresholding

1. Otsu’ method

The Otsu’s method is used to obtain the threshold value needed for the embedding

process. The method is based on the assumption that the image that is to be

thresholded contains two classes of pixels with values corresponding to the

foreground and background. It then calculates the optimum threshold value to

separate the 2 classes by maximizing the interclass variance.

The algorithm is composed of the following steps (Chen et al 2009):

(3-1)

where

is the interclass variance for value T

, (class probability with value ≦T)

, (class probability with values > T)

, (class mean)

, (class mean)

is processed iteratively with all possible values of T and with the desired threshold tho,

the value that maximizes the interclass variance σb2.

2. Histogram thresholding

If the histogram of an image includes some peaks, we can separate it into a number of

modes. Each mode is expected to correspond to a region, and there exists a threshold

at the valley between any two adjacent modes.

The midpoint method finds an appropriate threshold value in an iterative fashion

(Arifin & Asano 2006). The algorithm is outlined below:

1. Apply a reasonable initial threshold value

2. Compute the mean of the pixel values below and above this threshold,

respectively

3. Compute the mean of the two means and use this value as the new threshold

value. Continue until the difference between two consecutive threshold values are

smaller than a preset minimum.

3.1.2 Clustering

1. K-means clustering

In K-means algorithm data vectors are grouped into predefined number of clusters

(Irani 2009). At the beginning the centroids of the predefined clusters are initialized

randomly. The dimensions of the centroids are same as the dimension of the data

vectors. Each pixel is assigned to the cluster based on the closeness (Isa et al 2009),

which is determined by the Euclidian distance measure. After all the pixels are

clustered, the mean of each cluster is recalculated. This process is repeated until no

significant changes result for each cluster mean or for some fixed number of iterations.

Page 17: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[14]

The algorithm is composed of the following steps (Sathya & Manavalan 2011):

1. Place K points into the space represented by the objects that are being clustered.

These points represent initial group centroids.

2. Assign each object to the group that has the closest centroid.

3. When all objects have been assigned, recalculate the positions of the K centroids.

Repeat Steps 2 and 3 until the centroids no longer move. This produces a

separation of the objects into groups from which the metric to be minimized can

be calculated.

2. Fuzzy C-means clustering

Fuzzy C-means clustering (FCM) is a method of clustering which allows one piece of

data to belong to two or more clusters (Bradley & Fayyad 1998). That is it allows the

pixels belong to multiple classes with varying degrees of membership. It is based on

minimization of the following objective function:

(3-2)

Where, m is any real number greater than 1.uij is the degree of membership of xi in the

cluster j.

xi is the ith

of ddimensional measured data.

cj is the d-dimension center of the cluster.

The algorithm is composed of the following steps (Sathya & Manavalan 2011):

1. Initialize U= [ uij ] matrix, U (0)

2. At k-step: calculate the centers vectors c(k)= [cj] with U(k)

(3-3)

3. Update U(k)

, U k+1

(3-4)

4. If , then STOP; otherwise return to step 2.

3.1.3 Edge detection

Edge detection is a very important area in the field of Computer Vision. Edges define

the boundaries between regions in an image, which helps with segmentation and

object recognition (Ahmad & Choi. 1999).

The four steps of edge detection

1. Smoothing: suppress as much noise as possible, without destroying the true edges.

2. Enhancement: apply a filter to enhance the quality of the edges in the image.

3. Detection: determine which edge pixels should be discarded as noise and which

should be retained

4. Localization: determine the exact location of an edge.

The Roberts edge detector

(3-5)

(3-6)

Page 18: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[15]

This approximation can be implemented by the following masks:

(Note: Mx and My are approximations at (i + 1/2, j + 1/2))

The Prewitt edge detector

Consider the arrangement of pixels about the pixel (i, j):

The partial derivatives can be computed by:

Mx= (a2+ca3+a4)(a0+ca7+a6) (3-7)

My= (a6+ca5+a4)(a0+ca1+a2) (3-8)

The constant c implies the emphasis given to pixels closer to the center of the mask.

Setting c = 1, we get the Prewitt operator:

(Note: Mx and My are approximations at (i, j))

The Sobel edge detector

Setting c = 2, we get the Sobel operator:

(Note: Mx and My are approximations at (i, j))

The Canny edge detector

It was first created by John Canny for his Master’s thesis at MIT in 1983(Owens

1997). Canny has shown that the first derivative of the Gaussian closely approximates

the operator that optimizes the product of signal to noise ratio and localization. The

Canny edge detector is widely considered to be the standard edge detection algorithm

in the industry.

The algorithm is composed of the following steps:

1. Compute fx and fy

(3-9)

(3-10)

G(x, y) is the Gaussian function

Gx(x, y) is the derivate of G(x, y) with respect to x:

Gy(x, y) is the derivate of G(x, y) with respect to y:

2. Compute the gradient magnitude

(3-11)

3. Apply non-maxima suppression.

For each pixel (x, y) do:

If magn (i, j) < magn (i1, j1) or magn (i, j) < magn (i2, j2)

Else IN(i, j) = magn (i, j)

4. Apply hysteresis thresholding/edge linking.

Produce two thresholded images I1(i, j) and I2(i, j).

Page 19: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[16]

Link the edges in I2(i, j) into contours.

3.2 Algorithms of image enhancement

3.2.1 Linear transformation

Given vector spaces U and V, T: U→V is a linear transformation

If

For all λ, μ∈F, and u, v∈U. Then T (u+v) =T (u) +T (v), T (λu) = λT (u)

(3-12)

3.2.2 Denoising

Median filtering is a nonlinear method used for the removal of impulsive noise

(Padmavathi 2009). It is implemented to an image using a mask of odd length, the

mask moves over the image and at each center pixel the median value of the data

within the window is taken as the output. When the filter window is centered at the

beginning or at the end of the input image some values must be assigned to empty

window positions thus the first and the last value carryon appending strategy can be

applied which means the borders of the image can be filtered by duplicating the

outmost values.

3.2.3 Histogram equalization

Let f be a given image represented as a mr by mc matrix of integer pixel intensities

ranging from 0 to L1. L is the number of possible intensity values, often 256. Let p

denote the normalized histogram of f with a bin for each possible intensity. So:

The histogram equalized image g will be defined by

(3-13)

where floor() rounds down to the nearest integer. This is equivalent to transforming

the pixel intensities, k, of f by the function

(3-13)

4 Main work During this section, it devotes to find an appropriate image processing technique to

apply in welding inspection, which helps for practitioners of the welding industry to

improve inspection efficiency of defects recognition. On the other hand, the fact is

that general and traditional image processing technology can’t solve all the problems.

It contributes to propose the improved image processing theory or algorithm to solve

some the difficulties, which is regarded very useful for academics working with

image processing because the development of image processing theory or algorithm

can be further studied by those academics to use and apply widely in other areas.

During our experiments research, we main task is to answer how image segmentation

and image enhancement applied in welding inspection and which one of these two

shows good performance to be helpful for defects recognition.

Image segmentation is divided into three segmentation methods such as thresholding,

clustering and edge detection. We plan to do the experiments all of these three method

to see the evaluation performance of them.

Page 20: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[17]

Threshoulding is regarded a fast and simple method to classify and segment the image

information of the welding inspection films. It is widely used to fast image

segmentation during general image processing.

Clustering is a specific segmentation method because it can classify the characteristic

of the pixels by measuring their similarity. The characteristic of the pixels may be the

gray scale, room space information and so on. It is used to segment images for good

recognition during image processing.

And edge detection is the method more concerning about edge processing. Welding

inspection films always have much detail information around the edges which is

important to defects recognition. It is used to catch the detail information of edges for

good recognition during image processing.

Image enhancement method such as denoising, histogram equalization does more

working to enhance the concerning features noised by the psychical and external

factors during image processing.

According to the 2.5 section, we collect the testing sample from actual images of

welding detection for 2004 in Sinopec Pipeline Storage and Transportation Company.

The actual images are stratified by the category of welding defects. We collect 6

testing images from every category, especially in pore, crack, incomplete penetration

and incomplete fusion, which is as followed:

Figure 4.1 Sampling images of group 1

Figure 4.2 Sampling images of group 2

a). pore b). crack

c). incomplete fusion d). incomplete penetration

a). pore b). crack

c). incomplete fusion d). incomplete penetration

Page 21: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[18]

Figure 4.3 Sampling images of group 3

Figure 4.4 Sampling images of group 4

Figure 4.5 Sampling images of group 5

Figure 4.6 Sampling images of group 6

a). pore b). crack

c). incomplete fusion d). incomplete penetration

a). pore b). crack

c). incomplete fusion d). incomplete penetration

a). pore b). crack

c). incomplete fusion d). incomplete penetration

c). incomplete fusion d). incomplete penetration

a). pore b). crack

Page 22: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[19]

Sub question 5 “How does our proposed solution for applying image segmentation

perform in practical experiments?” is hopefully to be answered in next 4.1 and 4.2

sections.

4.1 Experiment 1: Application of Image Segmentation

Apply thresholding, clustering and edge detection to segment 4 groups of sampling

variable images based on image processing toolbox™ in MATLAB. Throughout

subjective evaluation, we choose the representative algorithm of these three methods

of image segmentation. And then representative algorithms are compared with each

other in objective way to give solution of Image Segmentation in welding detection.

4.1.1 Thresholding

1. Otsu’ method

In MATLAB, Function: level=graythresh (I), it computes global image threshold

using Otsu's method. The function uses Otsu's method, which chooses the threshold to

minimize the interclass variance of the black and white pixels. The Figure 4.7 shows

the segmented result of pore in group 1 using Otsu’ method and the others will be

shown in related appendix files.

Figure 4.7 Otsu’s method segmentation

2. Histogram thresholding

The Figure 4.8 shows the segmented result using Histogram thresholding and the

others will be shown in related appendix files. Histogram thresholding is based on

selecting the middle gray value as the threshold value between the two peaks, which

is diagramed in Figure 4.8.

Figure 4.8 Histogram thresholding segmentation

Seen in Figure 4.8, it is found out that there are two classic peaks in grey-scale

histogram diagram. Then we could select the middle gray value between them. It is

encouraged to test the appropriate middle gray value. Finally, by comparison of

Page 23: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[20]

values of 45 and 65, it is clear that segmented image with threshold value of 65 is

better.

3. Evaluation

After we have applied Otsu’s method and histogram thresholding to segment all the

sampling welding images, we invite the 5 persons who research on the image quality

to evaluate each segmented images according to subjective evaluation framework

demonstrated in the 2.3 section.

We collect the scoring tables given by them after evaluation and calculate related data,

which partly shown in the Table 4.1 and the other data will be detailed in related

appendix files.

Table 4.1 Data calculation 1

Finally, we get the evaluation result as followed.

Table 4.2 Evaluation result of thresholding

Seen in the Table 4.2, it can be found that the Otsu’s method is better than histogram

thresholding in ray detection of welding because it has higher quality in index during

our evaluation. It is true that histogram thesholding has the limitation when the grey-

scale histogram meets more two peaks which waste time test appropriate threshold.

However, Otsu’s method is fast and simply to set the appropriate threshold. So

combatively speaking, Otsu’s method is more suitable to be applied in welding

detection.

4.1.2 Clustering

1. K-means clustering

In K-means algorithm, we firstly initiate cluster centers and then decide the number of

iteration by a lot of tries to get the good quality of segmentation. The Figure 4.9

shows the segmented result using K-means clustering and the others will be shown in

Expert 4

Index Good(5) General(3) Bad(1)

Clarity √

Contrast √

Contour √

Convenience √

Amount Score 18

Expert 5

Index Good(5) General(3) Bad(1)

Clarity √

Contrast √

Contour √

Convenience √

Amount Score 14

Expert 1 Expert 2 Expert 3

Index Good(5) General(3) Bad(1) Index Good(5) General(3) Bad(1) Index Good(5) General(3) Bad(1)

Clarity √ Clarity √ Clarity √

Contrast √ Contrast √ Contrast √

Contour √ Contour √ Contour √

Convenience √ Convenience √ Convenience √

Amount Score Amount Score Amount Score 161820

No. Score No. Score

Expert 1 14.75 Expert 1 11.83

Expert 2 14.42 Expert 2 11.58

Expert 3 14.83 Expert 3 11.83

Expert 4 14.83 Expert 4 11.58

Expert 5 15.25 Expert 5 12.50

Average 14.82 Average 11.87

Otsu's method Histogram thesholding

Page 24: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[21]

related appendix files. In the Figure 4.9, the number of iteration is three, which could

get good result.

Figure 4.9 K-means clustering segmentation

2. Fuzzy C-means clustering

In MATLAB, algorithm of fuzzy C-means clustering is illustrated in the Figure 4.10.

Each pixel point is clustered by initial cluster centers and then cluster centers are

updated by loops. Seen in the following figure, variable of ttFcm is used to control the

loop process.

Figure 4.10 Flowchart of Fuzzy C-means

The Figure 4.11 shows the segmented result using Fuzzy C-means clustering and the

others will be shown in related appendix files.

Figure 4.11 Fuzzy C-means clustering segmentation

The traditional FCM clustering can shows good quality of image segmentation. But it

is hard to present the segmentation results in terms of gray scale. Therefore, here is to

propose an improved algorithm – Gray-scale based FCM clustering to present pixels

segmentation. On the basis of the traditional FCM clustering, the use of the

neighborhood pixel gray similarity to construct a new membership function, image

clustering segmentation. This method not only effectively suppresses noise

interference, and the wrong classification of pixels is easily rectified.

Page 25: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[22]

Expert 1 Expert 2 Expert 3

Index Good(5) General(3) Bad(1) Index Good(5) General(3) Bad(1) Index Good(5) General(3) Bad(1)

Clarity √ Clarity √ Clarity √

Contrast √ Contrast √ Contrast √

Contour √ Contour √ Contour √

Convenience √ Convenience √ Convenience √

Amount Score Amount Score Amount Score16 18 16

Expert 4

Index Good(5) General(3) Bad(1)

Clarity √

Contrast √

Contour √

Convenience √

Amount Score 14

Expert 5

Index Good(5) General(3) Bad(1)

Clarity √

Contrast √

Contour √

Convenience √

Amount Score 16

Neighborhood pixel gray similarity is calculated by following formula 4-1:

(4-1)

It is to generate new clustering center based on neighborhood pixel gray similarity.

The Figure 4.12 shows the segmented result using Gray-scale based Fuzzy C-means

clustering and the others will be shown in related appendix files.

Figure 4.12 Gray-scale based Fuzzy C-means clustering segmentation

It can be seen in the Figure 4.12, it is display the segmentation results in terms of gray

scale well, which is useful to next recognize the welding defects.

3. Interpretation of t image information data

After we have applied K-means and Gray-scale based Fuzzy C-means clustering to

segment all the sampling welding images, we also invite the same 5 persons to

evaluate each segmented images according to subjective evaluation framework

demonstrated in the 2.6 section.

We collect the scoring tables given by them after evaluation and calculate related data,

which partly shown in the Table 4.3 and the other data will be detailed in related

appendix files.

Table 4.3 Data calculation 2

Finally, we get the evaluation result as followed.

Table 4.4 Evaluation result of clustering

No. Score No. Score

Expert 1 14.00 Expert 1 10.58

Expert 2 15.17 Expert 2 9.17

Expert 3 14.00 Expert 3 10.58

Expert 4 14.25 Expert 4 9.08

Expert 5 13.75 Expert 5 12.08

Average 14.23 Average 10.30

Gray-scale based

Fuzzy C-meansK-means

Page 26: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[23]

Seen in the Table 4.4, it can be found that the Gray-scale based Fuzzy C-means is

better than K-means by comparison. It is true that K-means clustering has the

limitation in initially clustering for image of welding detection. However, Gray-scale

based Fuzzy C-means perform very well as well as the segmentation result. So

combatively speaking, Gray-scale based Fuzzy C-means clustering is very suitable to

be applied in welding detection.

4.1.3 Edge detection

For the gradient magnitude methods (Sobel, Prewitt, Roberts), thresh is used to

threshold the calculated gradient magnitude. The Canny method applies two

thresholds to the gradient: a high threshold for low edge sensitivity and a low

threshold for high edge sensitivity. Edge starts with the low sensitivity result and then

grows it to include connected edge pixels from the high sensitivity result. This helps

fill in gaps in the detected edges.

The Figure 4.13 shows the segmented result using edge detection and the others will

be shown in related appendix files. By comparisons with segmented results, we can

see image detected by canny operator has complete and meticulous edge, which is

illustrated in Figure 4.13. Based on qualitative evaluation, canny operator is better at

detecting the edges than other three.

Figure 4.13 Segmentation by edge detection

Finally, all the segmented results show the same thing that canny operator is very

suitable to be applied in welding detection because of its unparalleled good detection

performance.

4.1.4 Solution of image segmentation in welding detection

Based tries of different segmentation methods, we propose the following application

solution:

1. Use one of Otsu’ and Gray-scale based Fuzzy C-means clustering method to

segment image firstly, which shows fast segmentation speed and good

segmentation result.

2. Use Canny operator to detect the edges based on the image of first step, which

could help to compensate contours with good performance.

Evaluation on Otsu’ method and Fuzzy C-means clustering

We observe the objective index including Mean Squared Error (MSE), Signal to

Noise Ratio (SNR), Peak Signal to Noise Ratio (PSNR) and Mean absolute error

(MAE) of the images using Otsu’ method and Fuzzy C-means clustering.

Page 27: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[24]

Interpretation rules:

1. MSE and MAE: the smaller, the better.

2. SNR and PSNR: the larger, the better.

We collect all the index data from the MATLAB, shown in the Table 4.5. Seen in the

Table 4.5, according to above evaluation criteria, it is found that Fuzzy C-means

clustering gives better performance than Otsu’s method. Therefore, in step 1, we

firstly apply Fuzzy C-means clustering to image segmentation in welding detection.

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 7714.80 44.96 9.26 64.14 a 3045.56 49.00 13.29 34.73

b 8676.90 50.45 8.75 89.79 b 1819.27 56.52 15.53 32.17

c 11030.92 49.92 7.70 93.33 c 3574.90 54.81 12.60 42.57

d 18292.26 44.18 5.51 107.99 d 8021.24 48.00 9.09 65.19

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 8575.87 42.65 8.80 66.88 a 4027.94 46.10 12.08 36.37

b 16460.03 44.47 5.97 114.26 b 7501.31 47.97 9.38 65.83

c 5448.18 46.22 10.77 54.19 c 2074.68 50.41 14.96 24.37

d 10588.41 47.37 7.88 77.22 d 4037.36 51.56 12.07 44.05

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 6489.38 51.53 10.01 73.75 a 1229.80 58.75 17.23 26.33

b 5942.49 43.65 10.39 74.15 b 1391.11 49.96 16.70 32.75

c 9456.52 49.71 8.37 92.51 c 4473.40 52.96 11.62 58.64

d 6289.01 48.71 10.14 76.95 d 979.96 56.78 18.22 24.62

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 8198.18 42.76 8.99 61.39 a 2222.55 48.43 14.66 30.16

b 14306.92 50.54 6.58 118.49 b 4783.75 55.30 11.33 52.16

c 7519.82 52.26 9.37 76.05 c 2184.47 57.63 14.74 35.01

d 6666.68 48.69 9.89 64.13 d 889.38 57.43 18.64 19.22

Summary

Otsu's method Gray-scale based Fuzzy C-means Clustering

Group 1

Gray-scale based Fuzzy C-means Clustering

Group 2

Otsu's method Gray-scale based Fuzzy C-means Clustering

Group 3

The MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

The MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

The MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

The MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

Otsu's method Gray-scale based Fuzzy C-means Clustering

Group 4

Otsu's method

Page 28: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[25]

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 10189.31 40.25 8.05 66.06 a 4777.35 43.54 11.34 41.75

b 11796.32 45.88 7.41 85.43 b 4619.45 49.96 11.48 48.00

c 5605.52 49.21 10.64 63.52 c 408.28 60.58 22.02 15.68

d 4882.35 43.65 11.24 43.79 d 547.87 53.15 20.74 16.58

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 2803.81 48.36 13.65 40.77 a 593.72 55.10 20.40 13.91

b 9108.35 43.20 8.54 78.18 b 1024.45 52.69 18.03 25.27

c 22026.05 44.77 4.70 134.64 c 10981.77 47.79 7.72 81.57

d 6319.18 48.58 10.12 77.11 d 967.42 56.73 18.27 24.43

SummaryThe MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

Group 5

The MSE and MAE of Gray-scale based FCM is all smaller than Otsu.

The SNR and PSNR of Gray-scale based FCM is all larger than Otsu.

Otsu's method Gray-scale based Fuzzy C-means Clustering

Group 6

Otsu's method Gray-scale based Fuzzy C-means Clustering

Table 4.5 Evaluation on Otsu’ method and Gray-scale based Fuzzy Cmeans clustering

Application solution of image segmentation is as followed, which is also performed in

Figure 4.14.

1. Use Gray-scale based Fuzzy C-means clustering method to segment image firstly,

which shows fast segmentation speed and good segmentation result.

2. Use Canny operator to detect the edges based on the image of first step, which

could help to compensate contours with good performance.

Figure 4.14 Application solution of image segmentation

4.2 Experiment 2: Application of image enhancement

Apply linear transformation, denoising and image equalization algorithms to enhance

4 groups of sampling variable images based on image processing toolbox™ in

MATLAB. Compare results between image segmentation and image enhancement

according to objective quality indexes to verify superiority of image segmentation.

4.2.1 Solution of image enhancement

In image enhancement, we transform the range of grey value from [0.1, 0.5] to [0, 1],

eliminate the noise by median filtering based on 5*5 matrix and do image

equalization. The Figure 4.15 shows the image enhancement result.

a) Initial image b) Gray-scale based FCM clustering c) Canny edge detection

Page 29: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[26]

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 3045.56 49.00 13.29 34.73 a 12145.01 42.99 7.29 109.89

b 1819.27 56.52 15.53 32.17 b 3818.21 53.30 12.31 50.14

c 3574.90 54.81 12.60 42.57 c 4405.77 53.90 11.69 56.91

d 8021.24 48.00 9.09 65.19 d 9532.77 47.01 8.34 92.88

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 4027.94 46.10 12.08 36.37 a 13481.81 40.69 6.83 115.63

b 7501.31 47.97 9.38 65.83 b 11526.23 46.02 7.51 96.35

c 2074.68 50.41 14.96 24.37 c 11516.43 42.97 7.52 102.91

d 4037.36 51.56 12.07 44.05 d 10159.88 47.55 8.06 100.13

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 1229.80 58.75 17.23 26.33 a 3861.49 53.78 12.26 49.67

b 1391.11 49.96 16.70 32.75 b 5949.48 43.65 10.39 65.69

c 4473.40 52.96 11.62 58.64 c 6677.30 51.22 9.88 68.72

d 979.96 56.78 18.22 24.62 d 5215.67 49.52 10.96 62.29

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 2222.55 48.43 14.66 30.16 a 17952.17 39.36 5.59 133.15

b 4783.75 55.30 11.33 52.16 b 6770.39 53.79 9.82 69.51

c 2184.47 57.63 14.74 35.01 c 4278.45 54.71 11.82 54.66

d 889.38 57.43 18.64 19.22 d 8964.07 47.40 8.61 94.14

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 4777.35 43.54 11.34 41.75 a 19766.21 37.22 5.17 140.41

b 4619.45 49.96 11.48 48.00 b 7622.98 47.78 9.31 85.06

c 408.28 60.58 22.02 15.68 c 5580.31 49.23 10.66 68.99

d 547.87 53.15 20.74 16.58 d 25485.78 36.47 4.07 158.82

Summary

Group 4

Group 1

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Group 2

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Group 3

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Group 5

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Figure 4.15 image enhancement

4.2.2 Solution verification between image segmentation and image enhancement

We evaluate solution between image segmentation and image enhancement and

observe the objective index including Mean Squared Error (MSE), Signal to Noise

Ratio (SNR), Peak Signal to Noise Ratio (PSNR) and Mean absolute error (MAE) of

images using these two different solutions.

Interpretation rules:

1. MSE and MAE: the smaller, the better.

2. SNR and PSNR: the larger, the better.

We collect all the index data from the MATLAB, shown in the Table 4.6. Seen in the

Table 4.6, according to above evaluation criteria, it is found that image segmentation

gives better performance than image enhancement. Therefore, image segmentation is

very suitable to apply on photoreceptor ray film for ray inspection of welding and

compared with image enhancement, it will be more competitive.

Page 30: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[27]

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 2222.55 48.43 14.66 30.16 a 17952.17 39.36 5.59 133.15

b 4783.75 55.30 11.33 52.16 b 6770.39 53.79 9.82 69.51

c 2184.47 57.63 14.74 35.01 c 4278.45 54.71 11.82 54.66

d 889.38 57.43 18.64 19.22 d 8964.07 47.40 8.61 94.14

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 4777.35 43.54 11.34 41.75 a 19766.21 37.22 5.17 140.41

b 4619.45 49.96 11.48 48.00 b 7622.98 47.78 9.31 85.06

c 408.28 60.58 22.02 15.68 c 5580.31 49.23 10.66 68.99

d 547.87 53.15 20.74 16.58 d 25485.78 36.47 4.07 158.82

Summary

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

a 593.72 55.10 20.40 13.91 a 16051.11 40.78 6.08 125.17

b 1024.45 52.69 18.03 25.27 b 5482.80 48.40 10.74 61.16

c 10981.77 47.79 7.72 81.57 c 6140.56 52.74 10.25 61.34

d 967.42 56.73 18.27 24.43 d 5132.81 49.48 11.03 61.81

Summary

Group 4

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Group 5

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is all smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is all larger than Image Enhancement.

Group 6

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is mostly smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is mostly larger than Image Enhancement. Table 4.6 Evaluation on Image Segmentation and Image Enhancement

5 Conclusion

5.1 Application of image segmentation

In the 2.3 and 2.4 sections, we have answered sub question3 “How can we research on

the application of image segmentation in photoreceptor ray film of the ray inspection

of welding?”. We design experimental studies to research on the application of image

segmentation in photoreceptor ray film of the ray inspection of welding. We take

sampling as the method of data collection and then do data analysis by MATLAB.

Data analysis contains subjective evaluation on application of image segmentation

and objective evaluation on application of image enhancement.

In the section 2.2, we get the answer about sub question1 “What is the current

research situation of the ray inspection of welding?” and sub question2 “What is the

current research situation of the image segmentation such as application situation,

research history and so on?”. It introduces the current research situation of welding

ray detection in the first part. Shirai (1969) devotes to research on an algorithm for

automatic inspection of X-ray photographs and Alaknandea et al (2006) pay more

attentions on how to find the type of flaw and its causative factors. In addition, it

describes current research situation of image segmentation in the second and third part.

It gives the research history and application situation of popular image segmentation

method such as thresholding, clustering and edge detection.

Page 31: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[28]

In the section 3, we find the answer about sub question4 “Could a solution for ray

inspection of welding be proposed based on current theory within the field”. We

propose proposed solution of image segmentation or image enhancement application

in ray inspection of welding.

In the 4.1 and 4.2 sections, we successfully answer sub question5 “How does our

proposed solution for applying image segmentation perform in practical

experiments?”. We do feasible and performance analysis on our proposed solution of

image segmentation or image enhancement application in ray inspection of welding. It

is found that application of image segmentation is verified suitable to apply on

photoreceptor ray film for ray inspection of welding. The Figure 5.1 shows the

comparison result between image segmentation and image enhancement.

Figure 5.1 Comparison result between image segmentation and image enhancement

Application of image segmentation is more competitive than image enhancement

because that:

1. Gray-scale based FCM clustering of image segmentation performs well, which

can exposure pixels in terms of grey value level so as that it can show hierarchical

position of related defects by grey value.

2. Canny detection speeds also fast and performs well, that gives enough detail

information around edges and defects with smooth lines.

3. Image enhancement only could improve image quality including clarity and

contrast, which can’t give other helpful information to detect welding defects.

After answering all the sub questions, main question can be answered. We get our

conclusion that image segmentation is suitable to apply on photoreceptor ray film for

ray inspection of welding.

5.2 Evaluation strategy discussion

Whether the results of the study can be transferred to other situations is discussed in

this part. We do re-experiment using the sample from other situations. Take the

example of color portrait images we randomly select.

a) Initial image b) FCM clustering

c) Canny edge detection d) Image enhancement

Page 32: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[29]

Figure 5.2 Gray-scale based FCM segmentation of color portrait image

It is can be seen that the segmentation display pixels in terms of different gray scale

values.

Figure 5.3 Edge detection of color portrait image

It draws the same conclusion that Canny operator can gives enough detail information

around edges and defects with smooth lines more than the other three operators.

Figure 5.4 Image enhancement of color portrait image

And we evaluate on these two kinds of image processing technologies, it draws the

same result that:

1. Gray-scale based FCM clustering of image segmentation performs well, which

can exposure pixels in terms of grey value level so as that it can show hierarchical

Page 33: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[30]

position of related defects by grey value.

2. Canny detection speeds also fast and performs well, that gives enough detail

information around edges and defects with smooth lines.

3. Image enhancement only could improve image quality including clarity and

contrast, which can’t give other helpful information to detect welding defects.

No. MSE SNR PSNR MAE No. MSE SNR PSNR MAE

Color portrait image 12779.68 43.62 7.07 90.57 19107.49 41.89 5.32 110.733

Summary

Image Segmentation Image Enhancement

The MSE and MAE of Image Segmentation is mostly smaller than Image Enhancement.

The SNR and PSNR of Image Segmentation is mostly larger than Image Enhancement.

Table 5.1 Evaluation on Image Segmentation and Image Enhancement

All in all, we think that external validation, generalizability and test-retest reliability

reach to a high level.

The research design is sufficiently rigorous because we have design random sample to

eliminate subjective selection and the number of sample we think is enough to

inference the population.

In addition, we design the quantitative research from method of gather data, analysis

data and interpret data to assure the data is processed scientifically. Combination of

Mean opinion score and parameter observation is both subjective and objective, which

is regarded to be without any events intervened. So internal validation is evaluated to

reach a high level.

And it is hard to answer how similar the results are if the research is repeated using

different forms and how well the individual measures included in the research are

converted into a composite measure. Therefore, alternative forms reliability and

internal consistency reliability we regarded is at a lower level.

Then we complete the following evaluation table - Table 5.2. Generally speaking, it

can be concluded that our research process has good quality with stability. Level Low High

Validity Internal validation

External validation

Reliability

Test-retest reliability

Alternative forms reliability

Internal consistency reliability

Generalizability

Table 5.2 Evaluation on the research process

During research on application of image segmentation in ray inspection of welding,

we still have other questions to discuss, which can improve our work.

5.3 Discussion and knowledge contribution

We revisit a selection of the theories: canny operator of edge detection and Fuzzy C-

means clustering and image enhancement such as denoising and histogram

equalization, which are introduced in the theoretical chapter.

Page 34: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[31]

Though there are many theories and algorithms of image processing, but the current

lack of application research and knowledge in inspection of welding area makes it

difficult to answer any of them:

1. How can we apply image processing technology in inspection of welding area?

2. Which one shows the best?

3. How can we evaluate on application of image processing?

We have discussed and answered these questions adding to the existing body of

knowledge regarding image selection.

On the one hand, image segmentation and image enhancement of image processing

technologies can be applied in inspection of welding area. We do the experiment

research different alternative methods to get the performance analysis. We found that

gray scale based FCM and canny operator detection of image segmentation is superior

to image enhancement. It is very helpful to the practitioners of the welding industry.

They can smooth their work efficiency and the quality of defects recognition by

applying image segmentation techniques during their daily work.

On the other hand, it contributes to propose new improved Fuzzy C-means algorithm

– Gray-scale based Fuzzy C-means clustering, which might inspire academics studied

in image segmentation of computer science for applying to solving the similar

problem to give out the image segmentation with different gray scale level. In

addition, our research indicates specific future research trend and direction, which is

regarded to be the frontier topics of image segmentation within computer science.

5.4 Future research

During research on application of image segmentation in ray inspection of welding,

we still have other questions to discuss, which can improve our work.

5.4.1 Fuzzy c-means clustering easily plunges in local optimum because of inappropriate initial value.

Research on improvement of Fuzzy C-means clustering, it is hard to solve this

problem. Therefore, we try to find the answer by integrating other algorithm with

Fuzzy C-means clustering. Genetic algorithm is regarded to be suitable. Genetic

algorithm is adaptive heuristic search algorithm premised on the evolutionary ideas of

natural selection and genetic. Its characteristics are as followed:

Directly manipulate the object structure.

Better ability of global optimization and the use of probabilistic optimization

method.

Adaptively adjust the search direction and no need to determine the satisfaction

rules.

The genetic algorithm is:

1. Define clustering number c, range of data a, group size l, crossover probability Pc,

mutation probability Pm, Genetic number kmax and k←1

2. Initial clustering centers wi(k), i=1,2,…,c for number of l, code and format the

first generation of the gene string for number of l

3. Calculate fitness value f

4. Duplication, crossover and mutation, format the next generation of the gene string

Page 35: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[32]

5. Calculate fitness of new generation

6. k=k+1, if k< kmax, return to step 4 and 5, otherwise find the optimal value in the

last generation

We take the optimal value from genetic algorithm as the initial value of Fuzzy C-

means clustering and then run FCM process, which can assure that it converges on the

global optimum.

For example:

Researchers within the field of informatics can do the further research on the

improved Gay-scale based FCM algorithms by using Genetic algorithm.

In Gay-scale based FCM, clustering center is initiated manually so that it is easy to

reach the clustering of local optimum rather than global optimum.

Concretely speaking, the main work might be answer following questions:

1. What code is defined during genetic algorithm? Generally speaking, it is always

binary code with 1 and 0. Genetic value of the chromosome means whether a

pixel with the corresponding position is selected to be the clustering center. 1

means selected and 0 means not selected.

2. What’s the fitness function? The calculation of fitness is to control the

independent’s chance of survival, which is used to simulate the laws of nature.

3. What’s duplication, crossover and mutation operator? These operators are

important to initiate the next generation according biological condition.

4. What’s the termination condition of the genetic algorithm? It is useful to set the

condition of chosen of clustering center.

5.4.2 Image segmentation can’t do defect recognition in welding detection.

Obviously, application of image segmentation can only process photoreceptor-ray

film clearly, which is helpful for next defect recognition. Therefore, defect

recognition in welding detection is our future research work. And neural network is

considered to recognize defect category in welding detection. Neural networks are a

different paradigm for computing:

Von Neumann machines are based on the processing/memory abstraction of

human information processing.

Neural networks are based on the parallel architecture of animal brains.

This means that we can use much simpler, abstract "neurons", which (hopefully)

capture the essence of neural computation even if they leave out much of the details

of how biological neurons work.

As a particular type of neural network model, feed-forward back-propagation (BP)

network has a layered structure. Each layer consists of units which receive their input

from units from a layer directly below and send their output to units in a layer directly

above the unit. There are no connections within a layer, which can be seen in the

Figure 5.5 in detail.

Page 36: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[33]

Figure 5.5 Feed-forward back-propagation model

In welding detection, the number of input units is determined by the attributes of the

defects and the number of output units is determined by defect category.

For example:

Researchers within the field of informatics can do the further research on recognition

algorithm of welding defects such as realizing mode identification, establishing state

identification model and completing the automatic grading identification of the

welding line’s internal faults based on the identification model.

Feature analysis

1. Perimeter (L)

2. Major diameter (L1)

3. Short radius (L2)

4. Areas (S)

5. Ratio between square of perimeter and areas (RPA): RPA=L2/s. To better reflect

the parameters of the boundary features.

6. Aspect Ratio: L1/L2.

7. Ratio between the area of pixels and the perimeter pixels (RAP): RAP=S/L.

Reflect the size of the defect area enclosed unit boundary length.

Feature recognition rules:

If, L1/L2≤3, then classify to pores;

Else If, RAP≤1.2, then classify to cracks;

Else If, RPA≥0.8, then classify to incomplete fusion;

Else If, L1/L2≥5, Then classify to incomplete penetration;

Else, classify to slag inclusions.

As shown in the Figure 5.6, we design state identification model applied in defect

recognition of welding detection.

Figure 5.6 state identification models applied in defect recognition of welding

Page 37: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[34]

The number of hidden units is related with the numbers of input units and output units.

It can be calculated by empirical formula:

(5-1)

n is the number of input units, m is the number of output units, n1 is the number of

hidden units. The number of hidden units is 10. We code above BP model in to

learning samples and continuously learn from instance. After machine training, we

can get recognition results by forward inference of neural network.

Page 38: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[35]

6 Reference: 1. Alaknanda, Anand, R.S. & Kumar, P. 2006, “Flaw detection in radiographic weld

images using morphological approach”, NDT and E International, vol.39, no.1,

pp.2933.

2. Amir A.A., Zaccone M.A. 1996, “Inspectability of fillet welds on diverter panels

on an advanced missile fuel tank”, NDT and E International, vol.29, no.3,

pp.185185.

3. Arifin A.Z. & Asano A. 2006, “Image segmentation by histogram thresholding

using hierarchical cluster analysis”, Pattern Recognition Letters, vol.27, no.13,

pp.15151521.

4. Bardera A., Boada I., Feixas M. & Sbert, M. 2009, “Image Segmentation Using

Excess Entropy”, Journal of Signal Processing Systems, vol.54, no.1, pp.205214.

5. B Sathya & R Manavalan. 2011, “Image Segmentation by Clustering Methods:

Performance Analysis”, International Journal of Computer Applications, vol.29,

no.11, pp.2732.

6. Bradley P.S. & Fayyad U.M. 1998, “Refining initial points for K-means

clustering”, Machine Learning (ICML98), pp.9199.

7. Brad R. & Popovici Z.O. 2010, “Infrared satellite image segmentation”, IEEE

International Conference, pp. 100104.

8. C.Sasi varnan, A.Jagan,Jaspreet Kaur, Divya Jyoti & Dr.D.S.Rao. 2011, ”Image

Quality Assessment Techniques in Spatial Domain”, International Journal of

Computer Science and Technology, vol.2, no.3, pp.177184.

9. Chen J.J., Ng T.M., Lakshminarayanan A. & Garg H.K. 2009, “Adaptive Visible

Watermarking Using Otsu's Thresholding”, International Conference on

Computational Intelligence and Software Engineering, pp. 14.

10. Dr. G. Padmavathi, Dr. P. Subashini, Mr. M. Muthu Kumar & Suresh Kumar

Thakur. 2009, “Performance analysis of Non Linear Filtering Algorithms for

underwater images”, International Journal of Computer Science and Information

Security, vol.6, no.2, pp.232238.

11. Fu K.S. & Mui J.K. 1981, “A survey on image segmentation”, Pattern

Recognition, vol.13, no.1, pp.316.

12. Irani A.A.Z. Belaton. 2009, “A K-means Based Generic Segmentation System”,

B.Dept. of Comput. Sci., pp.300 – 307.

13. Isa N.A.M., Salamah S.A., Ngah U.K. Sch. of Electr. & Electron. Eng. 2009,

“Adaptive fuzzy moving K-means clustering algorithm for image segmentation”,

pp.2145 – 2153.

14. Jiang Y. & Zhou Z. 2004, “SOM EnsembleBased Image Segmentation”, Neural

Processing Letters, vol.20, no.3, pp.171178.

15. Mario G.C.A. Cimino, Beatrice Lazzerini & Francesco Marcelloni. 2006, “A

novel approach to fuzzy clustering based on a dissimilarity relation extracted

from data using a TS system”, Pattern Recognition, vol.39, no.11, pp.20772091.

16. Mharib A.M., Ramli A.R., Mashohor S. & Mahmood R.B. 2012, “Survey on liver

CT image segmentation methods”, Artificial Intelligence Review, vol.37, no.2,

pp.8395.

17. M.B. Ahmad & T.S. Choi. 1999, “Local Threshold and Boolean Function Based

Edge Detection”, IEEE Transactions on Consumer Electronics, vol.45, no.3,

pp.112118

18. Peng Wan. 2008, ”The Application of X-ray Detection System”, Computer

Society, pp.968972.

Page 39: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[36]

19. R. Owens. 1997. Computer Vision IT412 [Online]. Available at:

http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT6/

node2.html [Accessed: 5 May 2012].

20. Sun H., Sun Y., Bai P. & Zhou, P. 2005, ”Realtime automatic detection of weld

defects in steel Pipe”, NDT and E International, vol.38, no.7, pp. 522528.

21. Shirai Y. 1969, ”Automatic inspection of X-ray photograph of welding”, Pattern

Recognition, vol.1, no.4, pp.259258.

22. Thilagamani S. & Shanthi N. 2011, “A survey on image segmentation through

clustering”, International Journal of Research and Reviews in Information

Sciences, vol.1, no.1, pp.1416.

23. Pham Dzung L., Xu Chenyang, Prince Jerry L. 2000, “Current Methods in

Medical Image Segmentation”, Annual Review of Biomedical Engineering 2,

pp.315-337.

24. Zhang Y.J. 1996, “A survey on evaluation methods for image segmentation”,

Pattern Recognition, vol.29, no.8, pp.13351346.

Page 40: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[37]

7 Appendix 1. Otsu’ method in MATLAB

clc

clear all

I=imread('1.jpg');

subplot(1,2,1),imshow(I);

title('initial image')

level=graythresh(I); % setting grey thresholding value

BW=im2bw(I,level);

subplot(1,2,2),imshow(BW);

title('Otsu’ method segmentation ')

2. Histogram thresholding in MATLAB I=imread('1.jpg');

I1=rgb2gray(I);

figure;

subplot(2,2,1);

imshow(I1);

title('greyscaled image')

[m,n]=size(I1);

GP=zeros(1,256);

for k=0:255

GP(k+1)=length(find(I1==k))/(m*n);

end

subplot(2,2,2),bar(0:255,GP,'g') % display histogram diagram

title(' Greyscaled histogram diagram ')

xlabel(' Grey value')

ylabel(' Probability of occurrence ')

I2=im2bw(I,45/255);

subplot(2,2,3),imshow(I2);

title('segmented image of thresholding value 45')

I3=im2bw(I,65/255);

subplot(2,2,4),imshow(I3);

title(' segmented image of thresholding value 65')

3. K-means clustering in MATLAB I_rgb = imread('1.jpg');

subplot(1,2,1),imshow(I_rgb);

title(' initial image ');

C = makecform('srgb2lab');

I_lab = applycform(I_rgb, C);

ab = double(I_lab(:,:,2:3));

nrows = size(ab,1);

ncols = size(ab,2);

ab = reshape(ab,nrows*ncols,2);

nColors = 3; % initial cluster centers

[cluster_idx cluster_center] = K-

means(ab,nColors,'distance','sqEuclidean','Replicates',3); % iteration loops

pixel_labels = reshape(cluster_idx,nrows,ncols);

subplot(1,2,2),imshow(pixel_labels,[]), title('K-means clustering segmentation');

Page 41: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[38]

imwrite(pixel_labels,'K1.jpg','quality',100);

4. Gray-scale based Fuzzy C-means clustering in MATLAB IM11=imread('1.jpg');

subplot(1,2,1),imshow(IM11);

title(' initial image ')

%function[IX2]=fcm(IM);

IM1=IM11(:,:,1);

IM=double(IM1);

[maxX,maxY]=size(IM);

IMM=cat(5,IM,IM,IM,IM,IM);

cc1=8;

cc2=50;

cc3=100;

cc4=150;

cc5=200;

ttFcm=0;

while(ttFcm<15)

ttFcm=ttFcm+1

c1=repmat(cc1,maxX,maxY);

c2=repmat(cc2,maxX,maxY);

c3=repmat(cc3,maxX,maxY);

c4=repmat(cc4,maxX,maxY);

c5=repmat(cc5,maxX,maxY);

c=cat(5,c1,c2,c3,c4,c5);

ree=repmat(0.000001,maxX,maxY);

ree1=cat(5,ree,ree,ree,ree,ree);

distance=IMMc;

distance=distance.*distance+ree1;

daoShu=1./distance;

daoShu2=daoShu(:,:,1)+daoShu(:,:,2)+daoShu(:,:,3)+daoShu(:,:,4)+daoShu(:,:,5);

distance1=distance(:,:,1).*daoShu2;

u1=1./distance1;

distance2=distance(:,:,2).*daoShu2;

u2=1./distance2;

distance3=distance(:,:,3).*daoShu2;

u3=1./distance3;

distance4=distance(:,:,4).*daoShu2;

u4=1./distance4;

distance5=distance(:,:,5).*daoShu2;

u5=1./distance5;

ccc1=sum(sum(u1.*u1.*IM))/sum(sum(u1.*u1));

ccc2=sum(sum(u2.*u2.*IM))/sum(sum(u2.*u2));

ccc3=sum(sum(u3.*u3.*IM))/sum(sum(u3.*u3));

ccc4=sum(sum(u4.*u4.*IM))/sum(sum(u4.*u4));

ccc5=sum(sum(u5.*u5.*IM))/sum(sum(u5.*u5));

tmpMatrix=[abs(cc1ccc1)/cc1,abs(cc2ccc2)/cc2,abs(cc3ccc3)/cc3,abs(cc4ccc4)/c

c4,abs(cc5ccc5)/cc5];

pp=cat(4,u1,u2,u3,u4,u5);

for i=1:maxX

for j=1:maxY

Page 42: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[39]

if max(pp(i,j,:))==u1(i,j)

IX2(i,j)=1;

elseif max(pp(i,j,:))==u2(i,j)

IX2(i,j)=2;

elseif max(pp(i,j,:))==u3(i,j)

IX2(i,j)=3;

elseif max(pp(i,j,:))==u4(i,j)

IX2(i,j)=4;

else

IX2(i,j)=5;

end

end

end

% judge loop condition

if max(tmpMatrix)<0.0001

break;

else

cc1=ccc1;

cc2=ccc2;

cc3=ccc3;

cc4=ccc4;

cc5=ccc5;

end

for i=1:maxX

for j=1:maxY

if IX2(i,j)==5

IMMM(i,j)=240;

elseif IX2(i,j)==4

IMMM(i,j)=170;

elseif IX2(i,j)==3

IMMM(i,j)=125;

elseif IX2(i,j)==2

IMMM(i,j)=75;

else

IMMM(i,j)=25;

end end end end

for i=1:maxX

for j=1:maxY

if IX2(i,j)==5

IMMM(i,j)=240;

elseif IX2(i,j)==4

IMMM(i,j)=170;

elseif IX2(i,j)==3

IMMM(i,j)=125;

elseif IX2(i,j)==2

IMMM(i,j)=75;

else

IMMM(i,j)=25;

end

end

Page 43: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[40]

end

% display the segmented result

IMMM=uint8(IMMM);

subplot(1,2,2),imshow(IMMM);

title('Fuzzy C-means clustering segmentation')

5. Edge detection in MATLAB I=imread('1.jpg');

subplot(2,3,1);

imshow(I);

title('initial image');

I1=im2bw(I);

I2=edge(I1,'roberts');

subplot(2,3,2);

imshow(I2);

title(' detection by roberts operator ');

I3=edge(I1,'sobel');

subplot(2,3,3);

imshow(I3);

title(' detection by sobel operator ');

I4=edge(I1,'Prewitt');

subplot(2,3,4);

imshow(I4);

title(' detection by Prewitt operator ');

I5=rgb2gray(I);

I6=edge(I5,'canny');

subplot(2,3,6);

imshow(I6);

title(' detection by canny operator ');

6. Image evaluation in MATLAB file_name='1';

a=double(imread(file_name));

M=size(a,1);

file_name='O1';

b=double(imread(file_name));

N=size(b,2);

sum1=0;

for i=1:M;

for j=1:N;

sum1=sum1+(a(i,j)b(i,j))^2;

end;

end;

mseValue=sum1/(M*N); % calculate MSE

sum2=0;

for i=1:M;

for j=1:N;

sum2=sum2+(a(i,j))^2;

end;

end;

P=sum2;

snrValue=10*log10(P/mseValue); % calculate SNR

Page 44: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

[41]

psnrValue=10*log10(255^2/mseValue); % calculate PSNR

sum3=0;

for i=1:M;

for j=1:N;

sum3=sum3+abs(a(i,j)b(i,j));

end;

end;

Q=sum3;

maeValue=Q/(M*N);% calculate MSE

fprintf('\n MSE/SNR/PSNR/MAE of comparative image are %f / %f / %f/ %f

separately.\n',mseValue,snrValue,psnrValue,maeValue);

%display the MSE/SNR/PSNR/MAE

7. Image enhancement in MATLAB I=imread('1.jpg');

subplot(1,2,1),imshow(I);

title('initial image')

I1=rgb2gray(I);

J=imadjust(I1,[0.1 0.5],[]);

% transform the range of grey value from [0.1 0.5]to[0 1]

k2=medfilt2(J,[5,5]); % median filtering in 5*5

I2=histeq(k2); % image equalization

subplot(1,2,2),imshow(I2);

title('image enhancement');

Page 45: APPLICATION OF IMAGE SEGMENTATION IN INSPECTION OF …1308761/FULLTEXT01.pdf · 2019. 4. 30. · can be improved in terms of welding tools, welding technology and welding inspection.

University of Borås is a modern university in the city center. We give courses in business administration and informatics, library and information science, fashion and textiles, behavioral sciences and teacher education, engineering and health sciences. In the School of Business and IT (HIT), we have focused on the students' future needs. Therefore we have created programs in which employability is a key word. Subject integration and contextualization are other important concepts. The department has a closeness, both between students and teachers as well as between industry and education. Our courses in business administration give students the opportunity to learn more about different businesses and governments and how governance and organization of these activities take place. They may also learn about society development and organizations' adaptation to the outside world. They have the opportunity to improve their ability to analyze, develop and control activities, whether they want to engage in auditing, management or marketing. Among our IT courses, there's always something for those who want to design the future of ITbased communications, analyze the needs and demands on organizations' information to design their content structures, integrating IT and business development, developing their ability to analyze and design business processes or focus on programming and development of good use of IT in enterprises and organizations. The research in the school is well recognized and oriented towards professionalism as well as design and development. The overall research profile is BusinessITServices which combine knowledge and skills in informatics as well as in business administration. The research is professionoriented, which is reflected in the research, in many cases conducted on action researchbased grounds, with businesses and government organizations at local, national and international arenas. The research design and professional orientation is manifested also in InnovationLab, which is the department's and university's unit for researchsupporting system development.

VISITING ADDRESS: JÄRNVÄGSGATAN 5 · POSTAL ADDRESS: ALLÉGATAN 1, SE501 90 BORÅS

PHONE: + 46 33 435 40 00 · EMAIL: [email protected] · WEB: WWW.HB.SE/HIT