Practical Guide to Machine Vision Software - Kye-Si Kwon - E-Book

Practical Guide to Machine Vision Software E-Book

Kye-Si Kwon

0,0
69,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

For both students and engineers in R&D, this book explains machine vision in a concise, hands-on way, using the Vision Development Module of the LabView software by National Instruments.
Following a short introduction to the basics of machine vision and the technical procedures of image acquisition, the book goes on to guide readers in the use of the various software functions of LabView's machine vision module. It covers typical machine vision tasks, including particle analysis, edge detection, pattern and shape matching, dimension measurements as well as optical character recognition, enabling readers to quickly and efficiently use these functions for their own machine vision applications. A discussion of the concepts involved in programming the Vision Development Module rounds off the book, while example problems and exercises are included for training purposes as well as to further explain the concept of machine vision.
With its step-by-step guide and clear structure, this is an essential reference for beginners and experienced researchers alike.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 259

Veröffentlichungsjahr: 2014

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



CONTENTS

Cover

Related Titles

Title Page

Copyright

About the Authors

Preface

Chapter 1: Basics of Machine Vision

1.1 Digital Images

1.2 Components of Imaging System

Chapter 2: Image Acquisition with LabVIEW

2.1 Acquiring Images with MAX

2.2 Acquiring Images Using LabVIEW

Chapter 3: Particle Analysis

3.1 Particle Analysis Using Vision Assistant

3.2 LabVIEW Code Creation Using Vision Assistant

3.3 LabVIEW Code Modification

3.4 Particle Analysis Using Vision Express

3.5 Conversion of Pixels to Real-World Units

Exercise 3.1

Exercise 3.2

Exercise 3.3

Chapter 4: Edge Detection

4.1 Edge Detection via Vision Assistant

4.2 LabVIEW Code for Edge Detection

4.3 VI for Real-Time-Based Edge Detection

4.4 The Use of Vision Assistant Express for Real-Time Edge Detection

Exercise 4.1

Exercise 4.2

Chapter 5: Pattern Matching

5.1 Pattern Matching Using Vision Assistant

5.2 LabVIEW Code Creation and Modification

5.3 Main VI for Pattern Matching

5.4 Vision Assistant Express

Exercise 5.1

Exercise 5.2

Chapter 6: Color Pattern Matching

6.1 Color Pattern Matching Using Vision Assistant Express

Exercise 6.1

Chapter 7: Dimension Measurement

7.1 Dimension Measurement Using Vision Assistant Express

7.2 VI Creation for Dimension Measurement

Exercise 7.1

Chapter 8: Dimension Measurement Using Coordinate System

8.1 Measurement Based on a Reference Coordinate System Using Vision Assistant Express

8.2 Conversion of Vision Assistant Express to a Standard VI

Exercise 8.1

Chapter 9: Geometric Matching

9.1 Geometric Matching Using Vision Assistant Express

9.2 VI Creation for Geometric Matching

9.3 Shape Detection

Exercise 9.1

Chapter 10: Binary Shape Matching

10.1 Accessing Previously Saved Images with Vision Acquisition Express

10.2 Binary Shape Matching Using Vision Assistant

10.3 Overlay VI Creation for Shape Matching

10.4 VI for Binary Shape Matching

Exercise 10.1

Chapter 11: OCR (Optical Character Recognition)

11.1 OCR Using Vision Assistant

11.2 VI for OCR

Exercise 11.1

Exercise 11.2

Chapter 12: Binary Particle Classification

12.1 Vision Acquisition Express to Load Image Files

12.2 Vision Assistant Express for Classification

12.3 VI Modification

12.4 Overlay for Classification

12.5 Main VI for Classification

Exercise 12.1

Chapter 13: Contour Analysis

13.1 Contour Analysis

13.2 VIs for Contour Analysis

Exercise 13.1

Chapter 14: Image Calibration and Correction

14.1 Method for Creating an Image Correction File

14.2 Image Correction

Exercise 14.1

Chapter 15: Saving and Reading Images

15.1 Saving Image

15.2 Image Read from File

Exercise 15.1: Image save

Chapter 16: AVI File Write and Read

16.1 AVI File Creation Using Image Files

16.2 AVI File Creation Based on Real-Time Image Acquisition

16.3 Read Frame from AVI Files

Exercise 16.1

Chapter 17: Tracking

17.1 Tracking with the Use of Vision Assistant

17.2 VI Creation for Tracking Objects

Exercise 17.1

Chapter 18: LabVIEW Machine Vision Applications*

18.1 Semiconductor Manufacturing

18.2 Automobile Industry

18.3 Medical and Bio Applications

18.4 Inspection

18.5 Industrial Printing

Chapter 19: Student Projects

Project 1: Noncontact Motion Measurement and Its Analysis

Project 2: Intelligent Surveillance Camera

Project 3: Driving a LEGO NXT Car (LEGO Mindstorms) with Finger Motion

Project 4: Piano Keyboard Using Machine Vision

Index

EULA

List of Tables

Table 1.1

Table 1.2

Table 1.3

Table 1.4

Table 1.5

Table 2.1

Table 3.1

Table 3.2

Table 5.1

Table 6.1

Table 7.1

Table 7.2

Table 7.3

Table 14.1

Table 14.2

Table 15.1

List of Illustrations

Figure 1.1

Figure 1.2

Figure 1.3

Figure 1.4

Figure 1.5

Figure 1.6

Figure 1.7

Figure 1.8

Figure 1.9

Figure 1.10

Figure 1.11

Figure 1.12

Figure 2.1

Figure 2.2

Figures 2.3

Figure 2.4

Figure 2.5

Figure 2.6

Figure 2.7

Figure 2.8

Figure 2.9

Figure 2.10

Figure 2.11

Figure 2.12

Figure 2.13

Figure 2.14

Figure 2.15

Figure 2.16

Figure 2.17

Figure 2.18

Figure 2.19

Figure 2.20

Figure 2.21

Figure 2.22

Figure 2.23

Figure 3.1

Figure 3.2

Figure 3.3

Figure 3.4

Figure 3.5

Figure 3.6

Figure 3.7

Figure 3.8

Figure 3.9

Figure 3.10

Figure 3.11

Figure 3.12

Figure 3.13

Figure 3.14

Figure 3.15

Figure 3.16

Figure 3.17

Figure 3.18

Figure 3.19

Figure 3.20

Figure 3.21

Figure 3.22

Figure 3.23

Figure 3.24

Figure 3.25

Figure 3.26

Figure 3.27

Figure 3.28

Figure 3.29

Figure 3.30

Figure 3.31

Figure 3.32

Figure 3.33

Figure 3.34

Figure 3.35

Figure 3.36

Figure 3.37

Figure 3.38

Figure 3.39

Figure 3.40

Figure 3.41

Figure 3.42

Figure 3.43

Figure 3.44

Figure 3.45

Figure 3.46

Figure 3.47

Figure 3.48

Figure 3.49

Figure 3.50

Figure 3.51

Figure 3.52

Figure 3.53

Figure 3.54

Figure 3.55

Figure 3.56

Figure 3.57

Figure 3.58

Figure 3.59

Figure 3.60

Figure 3.61

Figure 3.62

Figure 3.63

Figure 3.64

Figure 3.65

Figure 3.66

Figure 4.1

Figure 4.2

Figure 4.3

Figure 4.4

Figure 4.5

Figure 4.6

Figure 4.7

Figure 4.8

Figure 4.9

Figure 4.10

Figure 4.11

Figure 4.12

Figure 4.13

Figure 4.14

Figure 4.15

Figure 4.16

Figure 4.17

Figure 4.18

Figure 4.19

Figure 4.20

Figure 4.21

Figure 4.22

Figure 4.23

Figure 5.1

Figure 5.2

Figure 5.3

Figure 5.4

Figure 5.5

Figure 5.6

Figure 5.7

Figure 5.8

Figure 5.9

Figure 5.10

Figure 5.11

Figure 5.12

Figure 5.13

Figure 5.14

Figure 5.15

Figure 5.16

Figure 5.17

Figure 5.18

Figure 5.19

Figure 5.20

Figure 5.21

Figure 6.1

Figure 6.2

Figure 6.3

Figure 6.4

Figure 6.5

Figure 6.6

Figure 6.7

Figure 6.8

Figure 6.9

Figure 6.10

Figure 6.11

Figure 6.12

Figure 6.13

Figure 6.14

Figure 6.15

Figure 6.16

Figure 6.17

Figure 7.1

Figure 7.2

Figure 7.3

Figure 7.4

Figure 7.5

Figure 7.6

Figure 7.7

Figure 7.8

Figure 7.9

Figure 7.10

Figure 7.11

Figure 7.12

Figure 7.13

Figure 7.14

Figure 7.15

Figure 7.16

Figure 7.17

Figure 7.18

Figure 7.19

Figure 7.20

Figure 7.21

Figure 7.22

Figure 7.23

Figure 7.24

Figure 7.25

Figure 8.1

Figure 8.2

Figure 8.3

Figure 8.4

Figure 8.5

Figure 8.6

Figure 8.7

Figure 8.8

Figure 8.9

Figure 8.10

Figure 8.11

Figure 8.12

Figure 8.13

Figure 8.14

Figure 8.15

Figure 8.16

Figure 8.17

Figure 8.18

Figure 8.19

Figure 8.20

Figure 8.21

Figure 9.1

Figure 9.2

Figure 9.3

Figure 9.4

Figure 9.5

Figure 9.6

Figure 9.7

Figure 9.8

Figure 9.9

Figure 9.10

Figure 9.11

Figure 9.12

Figure 9.13

Figure 9.14

Figure 9.15

Figure 9.16

Figure 9.17

Figure 9.18

Figure 9.19

Figure 9.20

Figure 9.21

Figure 9.22

Figure 9.23

Figure 9.24

Figure 10.1

Figure 10.2

Figure 10.3

Figure 10.4

Figure 10.5

Figure 10.6

Figure 10.7

Figure 10.8

Figure 10.9

Figure 10.10

Figure 10.11

Figure 10.12

Figure 10.13

Figure 10.14

Figure 10.15

Figure 10.16

Figure 10.17

Figure 10.18

Figure 10.19

Figure 10.20

Figure 10.21

Figure 10.22

Figure 11.1

Figure 11.2

Figure 11.3

Figure 11.4

Figure 11.5

Figure 11.6

Figure 11.7

Figure 11.8

Figure 11.9

Figure 11.10

Figure 11.11

Figure 11.12

Figure 11.13

Figure 11.14

Figure 11.15

Figure 11.16

Figure 11.17

Figure 11.18

Figure 11.19

Figure 11.20

Figure 11.21

Figure 11.22

Figure 11.23

Figure 11.24

Figure 12.1

Figure 12.2

Figure 12.3

Figure 12.4

Figure 12.5

Figure 12.6

Figure 12.7

Figure 12.8

Figure 12.9

Figure 12.10

Figure 12.11

Figure 12.12

Figure 12.13

Figure 12.14

Figure 12.15

Figure 12.16

Figure 12.17

Figure 12.18

Figure 12.19

Figure 12.20

Figure 12.21

Figure 12.22

Figure 12.23

Figure 12.24

Figure 12.25

Figure 12.26

Figure 13.1

Figure 13.2

Figure 13.3

Figure 13.4

Figure 13.5

Figure 13.6

Figure 13.7

Figure 13.8

Figure 13.9

Figure 13.10

Figure 13.11

Figure 13.12

Figure 13.13

Figure 13.14

Figure 13.15

Figure 13.16

Figure 13.17

Figure 13.18

Figure 13.19

Figure 13.20

Figure 13.21

Figure 13.22

Figure 13.23

Figure 13.24

Figure 13.25

Figure 13.26

Figure 14.1

Figure 14.2

Figure 14.3

Figure 14.4

Figure 14.5

Figure 14.6

Figure 14.7

Figure 14.8

Figure 14.9

Figure 14.10

Figure 14.11

Figure 14.12

Figure 14.13

Figure 14.14

Figure 14.15

Figure 14.16

Figure 14.17

Figure 14.18

Figure 15.1

Figure 15.2

Figure 15.3

Figure 15.4

Figure 15.5

Figure 15.6

Figure 15.7

Figure 15.8

Figure 15.9

Figure 15.10

Figure 15.11

Figure 15.12

Figure 15.13

Figure 15.14

Figure 15.15

Figure 15.16

Figure 15.17

Figure 15.18

Figure 16.1

Figure 16.2

Figure 16.3

Figure 16.4

Figure 16.5

Figure 16.6

Figure 16.7

Figure 16.8

Figure 16.9

Figure 16.10

Figure 16.11

Figure 16.12

Figure 17.1

Figure 17.2

Figure 17.3

Figure 17.4

Figure 17.5

Figure 17.6

Figure 17.7

Figure 17.8

Figure 17.9

Figure 17.10

Figure 18.1

Figure 18.2

Figure 18.3

Figure 18.4

Figure 18.5

Figure 18.6

Figure 18.7

Figure 18.8

Figure 18.9

Figure 18.10

Figure 18.11

Figure 18.12

Figure 18.13

Figure 18.14

Figure 18.15

Figure 19.1

Figure 19.2

Figure 19.3

Figure 19.4

Figure 19.5

Figure 19.6

Guide

Cover

Table of Contents

Begin Reading

Chapter 1

Pages

ii

iii

vi

ix

x

xi

xii

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

Related Titles

Hornberg, A. (ed.)

Handbook of Machine Vision

2006

Print ISBN: 978-3-527-40584-8; also available in electronic formats

Cyganek, B., Siebert, J.

An Introduction to 3D Computer Vision Techniques and Algorithms

2008

Print ISBN: 978-0-470-01704-3; also available in electronic formats

Steger, C., Ulrich, M., Wiedemann, C.

Machine Vision Algorithms and Applications

2008

Print ISBN: 978-3-527-40734-7

Gevers, T., Gijsenij, A., van de Weijer, J., Geusebroek, J.

Color in Computer Vision

Fundamentals and Applications

2012

Print ISBN: 978-0-470-89084-4; also available in electronic formats

Korvink, J. G., Smith, P. J., Shin, D.-Y. (eds.)

Inkjet-based Micromanufacturing

Series: Advanced Micro and Nanosystems (Volume 9)

2012

ISBN: 978-3-527-31904-6; also available in electronic formats

Cristobal, G., Perrinet, L., Keil, M. (eds.)

Biologically-inspired Computer Vision

Fundamentals and Applications

2016

Print ISBN: 978-3-527-41264-8; also available in electronic formats

Practical Guide to Machine Vision Software

An Introduction with LabVIEW

Kye-Si Kwon

Steven Ready

All books published by Wiley-VCH are carefully produced. Nevertheless, authors, editors, and publisher do not warrant the information contained in these books, including this book, to be free of errors. Readers are advised to keep in mind that statements, data, illustrations, procedural details or other items may inadvertently be inaccurate.

Library of Congress Card No.: applied for

British Library Cataloguing-in-Publication Data

A catalogue record for this book is available from the British Library.

Bibliographic information published by the Deutsche Nationalbibliothek

The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie; detailed bibliographic data are available on the Internet at http://dnb.d-nb.de.

© 2015 Wiley-VCH Verlag GmbH & Co. KGaA, Boschstr. 12, 69469 Weinheim, Germany

All rights reserved (including those of translation into other languages). No part of this book may be reproduced in any form – by photoprinting, microfilm, or any other means – nor transmitted or translated into a machine language without written permission from the publishers. Registered names, trademarks, etc. used in this book, even when not specifically marked as such, are not to be considered unprotected by law.

Print ISBN: 978-3-527-33756-9

ePDF ISBN: 978-3-527-68412-0

ePub ISBN: 978-3-527-68411-3

Mobi ISBN: 978-3-527-68410-6

oBook ISBN: 978-3-527-68277-5

About the Authors

Kye –Si Kwon

Web site:http://inkjet.sch.ac.kr/

E-mail:[email protected]

Kye-Si Kwon is an Associate Professor in the Department of Mechanical Engineering at Soonchunhyang University, Korea. He received his PhD in 1999 from KAIST, Korea. He was a member of research staffs in companies such as Samsung and LG electronics, in charge of hardware and software development based on LabVIEW until he joined Soonchunhyang University in 2006. As a university professor, he has been teaching many LabVIEW-related subjects and carries out his research projects using LabVIEW. His recent works include inkjet-related measurement methods and system developments using LabVIEW. In 2012, he worked for 1 year at PARC (Palo Alto Research Center) in Palo Alto, CA as a visiting researcher. He is also the founder of the start-up company PS. Co. Ltd (www.psolution.kr) and its current CEO. He actively uses LabVIEW Machine Vision for his new business.

Steve Ready

www.parc.com/Steve.Ready

Steve Ready is a Member of the Research Staff at Palo Alto Research Center in Palo Alto, CA. He obtained his degree in Physics from the University of California at Santa Cruz. Since joining PARC, Steve has designed real-time inkjet droplet visualization and analysis tools; designed and developed several high-accuracy inkjet printers for printed organic electronics, document printing, and printing of 3D objects; studied the role of hydrogen and dopants in amorphous, polycrystalline, and crystalline; and contributed to the development of large-area amorphous and polycrystalline silicon array systems for optical and X-ray imaging, displays, organic semiconductor materials, and devices.

Steve has also made significant contributions to developing laser crystallization of silicon thin films, a fragile book scanner, control software for MOCVD reactors, and a scanning tunneling microscope.

Preface

We believe the basics of engineering and research is measurement. Also, all improvement starts from the measurement. We believe that LabVIEW is one of the best software tools to implement most kinds of measurement. There have been many basic books written for those wanting to learn LabVIEW measurement, which enables one to learn LabVIEW with ease. However, there are not many books on LabVIEW vision for the beginner. The purpose of this textbook is to guide the student in using LabVIEW's Vision Development Module rather than developing deep understanding of the underlying vision algorithms. For this reason, we do not discuss the details behind specific vision algorithms. We do try to explain the concepts involved in programming with the NI Vision Development Module.

In this book the NI Vision Development Module is used to analyze objects in an image. The Vision Development Module includes hundreds of functions to process acquired images. However, for most beginners it may be difficult to understand and use the vision functions. The Vision Assistant, which is a component installed with NI Vision Development Module, is very easy to use and can create LabVIEW or C code in the process of guiding you through image processing steps. Vision Assistant provides access to almost all the vision functionality available in LabVIEW.

The approach of this book is to use the LabVIEW Vision Assistant to create the initial code that can perform vision measurement and provide the beginner a rapid understanding of LabVIEW vision programming. We feel that this is very easy approach for most of users. However, the software created directly from Vision Assistant does not generally provide the final programmed solution to a software project. So, we also guide the readers in how to use and modify the initially generated code from Vision Assistant.

This book assumes that readers have basic experience in LabVIEW programming. If you are a LabVIEW beginner, we suggest you to read a basic book on LabVIEW before starting vision programming. If your intended purpose is to only learn Vision Assistant and apply to your application immediately, we recommend you to use Vision Express. The method of using Vision Express for your application is addressed in each chapter.

In this book, Vision Development Module version 2013 is used for explanation, but the user of other versions can reference the book as there is usually only small difference between current versions.

We have tried to cover many subjects, from edge detection to optical character recognition (OCR), such that readers from various backgrounds can reference the book. Each chapter has examples to practice the vision programming. For real-time acquisition and image analysis, the use of a USB camera is mainly discussed because it is easily available for most of readers. However, LabVIEW provides many ways of acquiring images to apply to image analysis and machine vision.

Kye-Si Kwon

Soonchunhyang UniversityRepublic of Korea

Steven Ready

Palo Alto Research CenterPalo Alto, CA, USA

1Basics of Machine Vision

1.1 Digital Images

1.1.1 Grayscale Image

The basic digital image is composed of a two-dimensional array of numbers. Each number in the array represents a value of the smallest visual element, a pixel. The indexed location of the pixel value in the array corresponds to the X and Y locations of the pixel within the image, as measured from the top-left corner. The values of a pixel in an X and a Y location in the digital grayscale image, f(x,y), represent the brightness of the pixel in a range from black to white, as seen in Figure 1.1. Let us assume that total number of pixels are 300 (0–299) and 250 (0–249) in the X and Y locations, respectively. Each image can be represented by the array of size 300 × 250 that has a value for each pixel.

Figure 1.1 Grayscale image.

Each image pixel value is related to the brightness of the image at that specific location. For a given camera device, the maximum value recorded for the image pixels is generally related to a characteristic of the camera referred to as the bit depth. For example, if bit depth is k, then there will be as much as 2k levels of brightness that can be defined. For example, if the bit depth is 8 bits, then a pixel can have 256 values (28) in the range between 0 and 255.

A grayscale image pixel most often only has brightness information that can be represented in 8 bit values and as such the image is often referred to as an 8 bit image. If the pixel value is 0, then it is the most dark (black) image pixel, whereas a value of 255 means the brightest image (white) pixel. For a better understanding, Figure 1.1 shows a magnified portion of an image where the location range of X pixels is 85–91 and Y range is 125–130 within a total of 300 × 250 pixels in the image. In the case of pixel location of 85 along the X direction and 125 along the Y direction, the image pixel value is f(85, 125) = 197, which is closer to 255 than 0 and therefore is rendered closer to bright end of the image scale (white). On the other hand, the value of image pixel where X = 91 and Y = 125 is 14, which is close to 0 and thus relatively dark (black).

Due to its simple representation as single pixel values, grayscale images are often used in machine vision applications as a starting point to measure the length or size of an object and to find a similar image pattern via pattern matching. The gray images can be acquired from digital monochrome or color cameras. When the color image is acquired, the color image can easily be converted to a grayscale image by using the color plane extraction function that is provided by NI Vision Development Module.

1.1.2 Binary Image

The most commonly used image format for finding the existence of the object, location, and size information is binary image. The binary image pixel has two digit values, where object has the value of 1 and background has the value of 0 in most cases. Since there are only two values used, it is often called a 1 bit image (bit depth of 1, or 21). To make a binary image, the grayscale image is commonly used as a starting point. In general, we use a threshold value to convert a grayscale image to a binary image. In the case that the object of interest in an image is bright against a dark background (the imaged object's pixel value is larger than a chosen threshold value), it is classified as the object (a pixel image value of 1) and if the image value is less than the threshold value, it can be classified as the background (the pixel image value of 0). However, it should be noted that there will be cases where the dark parts of an image may represent the object with the bright part comprising the background.

Once the grayscale image is converted to a binary image, various image processing functions can be used. For example, we can use the particle analysis function from which the size, area, and the center of the object can be easily obtained. Prior to particle analysis, the morphology functions are often used to modify aspects of the image for better or more reliable results. For example, we may want to remove unnecessary parts from the binary image or repair parts of an object that obviously misrepresents the object in the grayscale to binary conversion. By using the morphology functions in the LabVIEW Vision Development module, we can increase the accuracy of image analysis based on the binary image. Details of this process will be discussed later.

1.1.3 Color Image

Digital color images from digital cameras are usually described by three color values: R (red), G (green), and B (blue). The three color values that represent an image pixel describe the color and brightness of the pixel. In other words, the brightness and color of the pixels in an image obtained from a digital color camera are generally defined by the combination of the R, G, and B values. All possible colors can be represented by these three primary colors. The digital color image is often referred to as a 24 or 32 bit image. Figure 1.2 shows the basic concept of a 32 bit color image. Among four possible 8 bit values in a 32 bit word, we use 8 bits for each of the R, G, and B components. The other 8 bit component is not used. This is due to the computer's natural representation of an integer as a 32 bit number.

Figure 1.2 32 bit color image.

Figure 1.3 shows an example of a color image. The total size of the image is 800 × 600. The X direction has 800 (0–799) pixels and Y direction has 600 (0–599) pixels. Each pixel has three component values representing R, G, and B. For example, the image value at X = 600, Y = 203, f(600, 203), is R = 196, G = 176, B = 187.

Figure 1.3 Color image (f(x, y) = 0 ≤ R ≤ 255, 0 ≤ G ≤ 255, 0 ≤ B ≤ 255).

For a better explanation, a USB camera was used to acquire the images via a LabVIEW VI, as shown in Figure 1.4. As seen in the lower part of Figure 1.4, the total size of the image (the number of pixels) is 640 × 480. The pixel location is defined by the X and Y locations, where upper left is (0,0) and lower right is (639,479). Each of the RGB values in a pixel has an 8 bit value, which corresponds to an integer range of 0–255. When we move the mouse cursor over the acquired image, the pixel's RGB values pointed to by the mouse cursor are shown at the bottom of the window. In the example as seen in Figure 1.4, the RGB values at the mouse X/Y image position (257,72) are (255,253,35).

Figure 1.4 Acquired color image.

Each pixel color and brightness is the combination of RGB values. For example, R (red) has the range of values between 0 and 255. If the value is close to 0, the R image becomes dark red, which can be seen as black. On the other hand, if the image value of R becomes 255, then the R component becomes the brightest, which is seen as bright red. The green and blue pixel component values have same property. If the R = 255, G = 0, and B = 0, then the pixel appears to be bright red. If all three RGB values are 255, then the pixel appears to be white (bright pixel), whereas if the RGB values are 0, then the pixel becomes dark (black).

One alternative method for color image representation, HSL (hue, saturation, and luminance), can be used instead of RGB (Table 1.1). The three HSL values are also generally represented by 8 bit values for each component. By using proper values of HSL, any color and brightness can be displayed in a pixel.

Table 1.1 The meaning of HSL.

Hue

Saturation

Luminance

Hue defines the color of a pixel such as red, yellow, green, and blue or combination of two of them. It is related to wavelength of a light.

Saturation refers to the amount of white added to the hue and represents the relative purity of a color. If the saturation increases, color becomes pure. If colors are mixed, the saturation decreases. For example, red has higher saturation compared with pink.

Luminance is closely related with the brightness of image. Extracting the luminance values of an HSL color image results in a good conversion of a color image to a grayscale representation.

1.2 Components of Imaging System

Figure 1.5 shows the basic components of imaging systems. Imaging acquisition hardware requires a camera, lens, and lighting source. To get an image from the camera to the computer, we need to select the most appropriate camera communication interface (bus), which connects the camera to the computer. Some cameras require specific types of standardized communication busses integrated into computer interface cards called frame grabbers. Examples of a few standardized frame grabber communication busses are Analog, Camera Link, and Gigabit Ethernet (GigE). Other cameras connect to the computer over more common communication interfaces such as USB, Ethernet, or Fire Wire that are provided as standard configurations in most computers.

Figure 1.5 Basic component of imaging system.

Software is also needed to display and extract information from images. In this book, image processing techniques will be described for the purpose of processing and analyzing the acquired images. While there are a number of software programs that can be used to develop image measurement applications, we will be focusing on methods using the LabVIEW Vision Development module from National Instruments.

1.2.1 Camera