Image Processing With LabVIEW And IMAQ Vision

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Publisher: Prentice Hall

Language: English
Pages: 360

Figure 5.59. Reading an Analog Needle Instrument......Page 320
Bibliography......Page 1
Structure of This Book......Page 2
Software and Utilities......Page 3
Table 1.1. Summary of Discussed National Instruments' Software Packages......Page 4
Hardware Configuration......Page 5
Figure 1.1. Ultrasound Imager (left) and Refractometer (right)......Page 6
Figure 1.2. Scientific Microscope (left) and Visual Presenter (right)......Page 7
Figure 1.3. Network Structure with Simultaneous Use of Ethernet and IEEE 1394......Page 8
What Is an Image?......Page 9
Figure 1.4. Definition of an Image as a Rectangular Matrix......Page 10
Figure 1.5. Definition of a Color Image as Multiplane Image......Page 11
The Difference: Image Processing or Image Analysis?......Page 13
Figure 1.8. Image Analysis Example. The object detection algorithm returns the number of detected objects in the left image.......Page 14
Real Time or "Really Fast"?......Page 15
Introduction to IMAQ Vision Builder......Page 16
Figure 1.9. IMAQ Vision Builder Environment. 1 Reference Window, 2 Script Window, 3 Image Size, 4 Zoom Ratio, 5 Processing Window [7]......Page 17
Figure 1.10. IMAQ Vision Builder Image Browser. 1 Image Browser, 2 Image Location, 3 Browse Buttons, 4 Thumbnail/Full-Size Toggle, 5 Image Size, 6 Close Selected Image(s), 7 Image Type, 8 File Format [7]......Page 18
Figure 1.11. Acquiring Images into IMAQ Vision Builder. 1 Acquisition Window, 2 Acquisition Property Page, 3 Store Acquired Image in Browser Button, 4 IMAQ Image Acquisition Board and Channels [7]......Page 19
Figure 1.12. Edge Detection with a Line Profile. 1 Edges of Particles, 2 Fluctuation in Pixel Values, 3 Segment Drawn with Line Tool [7]......Page 21
Figure 1.13. Using the Caliper Tool [7]......Page 22
Figure 1.14. Creating a Script File for Blob Analysis [7]......Page 24
Figure 1.15. LabVIEW VI Creation Wizard......Page 28
Figure 1.16. metal.vi Created by the VI Creation Wizard......Page 29
NI Vision Builder for Automated Inspection......Page 30
Figure 1.18. NI Vision Builder AI Inspection Interface. 1 Results Panel, 2 Display Window, 3 Inspection Statistics Panel [10]......Page 31
Configuration Interface......Page 32
Figure 1.20. Measuring the Distance Between Two Edges [10]......Page 33
Inspection Interface......Page 34
Figure 2.1. Questions Regarding Pixel Transfer......Page 36
Figure 2.2. Principle of a CCD Sensor......Page 37
Figure 2.3. CCD Transfer Mechanism [14]......Page 38
Figure 2.4. Charge Transfer Efficiency (CTE) as a Function of Pulse Length [14]......Page 39
Figure 2.5. Impact of Charge Transfer Efficiency (CTE) on Pixel Brightness......Page 40
Figure 2.6. Charge Transfer Efficiency (CTE) Far Too Low......Page 41
Figure 2.7. Structure of Surface Channel and Buried Channel CCDs......Page 42
Buried Channel CCDs......Page 43
Sensitivity and Resolution......Page 44
Figure 2.8. Visualization of the Modulation Transfer Function (MTF). How many pixels are needed to distinguish between a certain number of black and white lines?......Page 45
Noise and "Hot Pixels"......Page 46
Figure 2.10. MediaChance Hot Pixel Eliminator......Page 47
Figure 2.11. Blooming Effect Caused by a Laser Pointer......Page 48
Figure 2.12. Blooming Effect (Exercise)......Page 49
Image Smear......Page 50
Linear CCD Sensors......Page 51
Image Sensors......Page 52
Figure 2.16. Comparison of Interline and Frame Transfer Structures......Page 53
Line-Scan Cameras......Page 54
Figure 2.19. Line-Scan Sensor Used in a Flat-Bed Scanner......Page 55
Figure 2.20. Principle of a CMOS Image Sensor......Page 56
Figure 2.21. CMOS (Color) Sensor Chip......Page 57
Figure 2.22. Blooming Effect in CCD (left) and CMOS Cameras (right)......Page 59
Video Standards......Page 60
Figure 2.24. Video Frames (European CCIR Standard)......Page 61
Figure 2.26. RS 170 Standard Timing Diagram......Page 62
Figure 2.27. Interlaced Mode of a CCD Video Sensor......Page 63
Figure 2.28. Noninterlaced Mode and Progressive Scan Sensor......Page 64
Color Images......Page 65
Color Models......Page 66
Figure 2.31. RGB Color Cube......Page 67
The CMY (CMYK) Color Model......Page 68
Figure 2.32. HSI Color Triangle and Color Solid......Page 70
Figure 2.33. Front Panel of the VI Created in Exercise 2.4......Page 71
Figure 2.34. Diagram of the VI Created in Exercise 2.4......Page 72
The YIQ Color Model......Page 73
Color Video Standards......Page 74
Table 2.5. Standards for Digital Video......Page 75
Other Image Sources......Page 76
Figure 2.36. Principle of Ultrasound A and M Mode [19]......Page 77
Figure 2.37. Curved Array Ultrasound Head and Corresponding Image......Page 78
Computed Tomography......Page 79
Figure 2.38. CT Device Generations 1 to 4 [20]......Page 80
CT Image Calculation and Back Projection......Page 81
Figure 2.39. Simple Calculation of a CT Image [20]......Page 82
Figure 2.41. Iterative Calculation of a CT Image......Page 83
Figure 2.42. Separation of Energy Levels According to Spin Directions......Page 85
Figure 2.43. Relaxation Times T1 and T2......Page 87
Figure 2.44. MRI Images: Based on T1 (left) and T2 (right) of a Knee Joint......Page 88
Figure 3.1. Getting an Image into a PC......Page 90
Figure 3.2. Typical Block Diagram of a PCI Frame Grabber......Page 91
IEEE 1394 (FireWire)......Page 92
Fundamentals......Page 93
Figure 3.4. Windows Device Manager Listing 1394 Devices......Page 94
Figure 3.5. 1394 Zip100 Drive and 1394 Hard Drive......Page 95
Figure 3.6. 1394 Video Camera......Page 96
Figure 3.8. 1394 PC104 Boards (1STT Components; www.1stt.com)......Page 97
Figure 3.9. Isochronous and Asynchronous Transactions[26]......Page 98
Table 3.2. Maximum Data Payload Size for Asynchronous and Isochronous Transfers......Page 99
Figure 3.11. 1394 4-Pin Connector (Plug and Socket)......Page 100
Figure 3.12. Cross Sections of 4-Conductor and 6-Conductor Cables......Page 101
1394 Bus Configuration......Page 102
1394 Bus Management......Page 103
Power Management......Page 104
1394 Images in LabVIEW......Page 105
Figure 3.16. 1394 Camera Image and Properties in IMAQ Vision Builder......Page 106
Universal Serial Bus (USB)......Page 107
Figure 3.18. Windows Device Manager Listing USB Devices......Page 108
Figure 3.19. USB Hub Types [27]......Page 109
USB Devices......Page 110
Figure 3.21. USB Hub with Four Ports......Page 111
Figure 3.22. USB Mass Storage Device and USB Camera......Page 112
Figure 3.23. Cross Sections of Low-Speed and High-Speed USB Cables [27]......Page 113
Figure 3.25. USB Cables Using NRZI Encoding and Differential Signaling [27]......Page 114
Figure 3.26. NRZI Encoding [27]......Page 115
Data Environment......Page 116
USB Images in LabVIEW......Page 117
Figure 3.27. Importing USB Camera Images in LabVIEW......Page 118
Camera Link......Page 119
Figure 3.28. Camera Link Block Diagram (Base Configuration)......Page 120
Table 3.3. Camera Link Configurations......Page 121
Compression Techniques......Page 122
Figure 3.30. Compression Techniques and Algorithms......Page 123
Huffman Coding......Page 124
Figure 3.31. Example of Huffman Coding......Page 125
Lempel-Ziv Coding......Page 126
Arithmetic Coding......Page 127
Figure 3.33. Arithmetic Coding Example......Page 128
MH, MR, and MMR Coding......Page 129
Discrete Cosine Transform (DCT)......Page 130
Figure 3.36. Calculating 8 x 8 DCT Coefficients with LabVIEW......Page 131
Figure 3.37. Diagram of Exercise 3.3......Page 132
JPEG Coding......Page 133
Figure 3.40. JPEG Quantization Table and Coefficient Reading......Page 134
Figure 3.41. 2D Wavelet Transform Example (LabVIEW Signal Processing Toolkit)......Page 135
Figure 3.42. JPEG2000 Generation Tool (www.aware.com)......Page 137
Windows Bitmap Format (BMP)......Page 138
Table 3.6. Structure of the BMP File Header......Page 139
Table 3.7. Structure of the BMP Info Header......Page 140
Graphics Interchange Format (GIF)......Page 141
Table 3.10. Structure of the GIF Logical Screen Descriptor......Page 142
Tag Image File Format (TIFF 6.0)......Page 143
Table 3.14. TIFF IFD Block Structure......Page 144
Table 3.16. Tag Data Types......Page 145
Table 3.18. Image Pointer Tags......Page 146
Table 3.20. Data Orientation Tags......Page 147
Table 3.23. Storage Management Tags......Page 148
Table 3.26. YCbCr Management Tags......Page 149
Table 3.27. CHUNK Structure......Page 150
Table 3.29. Palette (PLTE) CHUNK......Page 151
Table 3.32. Textual Data (tEXt) CHUNK......Page 152
ZSoft Paintbrush File Format (PCX)......Page 153
JPEG/JFIF and JPEG2000 (JPG, J2K)......Page 154
Table 3.36. JFIF EOI Segment......Page 155
Table 3.39. Define Huffman Table (DHT) Segment......Page 156
Table 3.42. Comparison of Image Standards......Page 157
Modalities......Page 158
Data Elements......Page 159
Value Representations (VRs)......Page 160
Value Lengths (VLs)......Page 161
DICOM Image Storing......Page 162
Figure 3.46. ActiveX Control Import List......Page 164
Figure 3.48. Verification of the Correct Import of Accusoft DICOM Comm SDK in LabVIEW......Page 165
Figure 3.50. Frames 0 and 1 of Exercise 3.5......Page 167
Histogram and Histograph......Page 169
Figure 4.1. Histogram Function in IMAQ Vision Builder......Page 170
Figure 4.3. Histogram Exported in MS Excel......Page 171
Using Look-up Tables (LuT)......Page 172
Figure 4.5. Exercise 4.2: Creating User LuTs......Page 173
Figure 4.6. Processing Look-up Tables (LuTs)......Page 174
Figure 4.8. Creating an Exponential Look-up Table......Page 176
Figure 4.9. Creating a Square Look-up Table......Page 177
Figure 4.11. Creating a Power x Look-up Table......Page 178
Figure 4.12. Creating a Power 1/x Look-up Table......Page 179
Figure 4.13. Image and Histogram Resulting from Equalizing......Page 180
Figure 4.14. Diagram of Exercise 4.3......Page 181
Figure 4.15. Inverting the Bear Image......Page 182
Figure 4.16. Diagram of Exercise 4.4......Page 183
Special LuTs: BCG Values......Page 184
Figure 4.17. Using Special LuTs for Modifying Brightness and Contrast......Page 185
Figure 4.18. Diagram of Exercise 4.5......Page 186
Spatial Image Filtering......Page 187
Figure 4.19. Moving the Filter Kernel......Page 188
Kernel Families......Page 190
Figure 4.21. Visualizing Effects of Various Filter Kernels......Page 191
Figure 4.22. Diagram of Exercise 4.7......Page 192
Figure 4.23. Filter Example: Smoothing (#5)......Page 193
Figure 4.24. Filter Example: Gaussian (#4)......Page 194
Filter Families: Gradient......Page 195
Figure 4.26. Filter Example: Gradient (#1)......Page 196
Figure 4.27. Filter Example: Gradient (#4)......Page 197
Figure 4.28. Filter Example: Laplace (#0)......Page 199
Figure 4.29. Filter Example: Laplace (#1)......Page 200
Figure 4.31. Filter Example: Laplace (#7)......Page 201
Figure 4.32. Waveform Spectrum......Page 202
Figure 4.34. FFT Spectrum of an Image......Page 204
FFT Filtering: Truncate......Page 206
Figure 4.37. Diagram of Exercise 4.9......Page 207
Figure 4.38. FFT High-Pass Filter......Page 208
FFT Filtering: Attenuate......Page 209
Figure 4.40. FFT High-Pass Attenuation Result......Page 210
Figure 4.41. Morphology Functions in IMAQ Vision Builder......Page 211
Figure 4.42. Thresholding with IMAQ Vision Builder......Page 212
Figure 4.43. Result of Thresholding Operation......Page 213
Figure 4.45. Diagram of Exercise 4.11......Page 214
Figure 4.47. Diagram of Exercise 4.12......Page 216
Figure 4.48. Examples of Structuring Elements......Page 218
Erosion and Dilation......Page 220
Figure 4.51. Diagram of Exercise 4.13......Page 221
Opening and Closing......Page 223
Figure 4.54. Morphology: Closing Result......Page 224
Proper Opening and Proper Closing......Page 225
Figure 4.55. Morphology: Proper Opening Result......Page 226
Hit-Miss Function......Page 227
Figure 4.58. Hit-Miss Result with Structuring Element That Is All 0s......Page 228
Figure 4.60. Outer Gradient (External Edge) Result......Page 230
Thinning and Thickening......Page 231
Figure 4.62. Morphology: Thinning Result......Page 232
Auto-Median Function......Page 233
Figure 4.65. Remove Particle: Low Pass......Page 234
Figure 4.66. Diagram of Exercise 4.14......Page 235
Figure 4.68. Particles Touching the Border Are Removed......Page 236
Figure 4.69. Diagram of Exercise 4.15......Page 237
Figure 4.70. Particle Filtering by x Coordinate......Page 238
Figure 4.71. Diagram of Exercise 4.16......Page 239
Figure 4.72. Filling Holes in Particles......Page 241
Figure 4.73. Diagram of Exercise 4.17......Page 242
Figure 4.75. Diagram of Exercise 4.18......Page 243
Separation and Skeleton Functions......Page 244
Figure 4.77. Diagram of Exercise 4.19......Page 245
Figure 4.78. IMAQ MagicWand: Separating Objects from the Background (National Instruments Example)......Page 246
Figure 4.79. L-Skeleton Function......Page 247
Figure 4.80. Diagram of Exercise 4.20......Page 248
Figure 4.81. M-Skeleton Function......Page 249
Gray-Level Erosion and Dilation......Page 250
Figure 4.84. Diagram of Exercise 4.21......Page 251
Gray-Level Opening and Closing......Page 253
Figure 4.88. Gray Morphology: Closing......Page 254
Figure 4.90. Gray Morphology: Proper Closing......Page 255
Figure 4.91. Gray Morphology: Auto-Median Function......Page 256
Figure 5.1. Line Profile Function in IMAQ Vision Builder......Page 257
Figure 5.2. Line Profile of an Image......Page 258
Figure 5.3. Diagram of Exercise 5.1......Page 259
Figure 5.4. Menu Palette Containing Overlay Functions......Page 260
Figure 5.5. Quantifying Image Areas with IMAQ Vision Builder......Page 261
Figure 5.7. IVB (IMAQ Vision Builder) Functions......Page 262
Linear Averages......Page 263
Figure 5.10. Diagram of Exercise 5.2......Page 264
Simple Edge Detector......Page 265
Figure 5.12. Diagram of Exercise 5.3......Page 266
IMAQ Edge Detection Tool......Page 267
Figure 5.15. Diagram of Exercise 5.4......Page 268
Figure 5.16. Detecting Peaks and Valleys of a Line Profile......Page 269
Figure 5.17. Diagram of Exercise 5.5......Page 270
Locating Edges......Page 271
Figure 5.19. Locating Edges in Images......Page 272
Figure 5.20. Locating Horizontal Edges......Page 273
Figure 5.22. Diagram of Exercise 5.7......Page 274
Figure 5.23. Edge-Locating Result (Motor)......Page 275
Distance and Danielsson......Page 276
Figure 5.25. Diagram of Exercise 5.8......Page 277
Figure 5.26. Distance Function Applied to a Binary Motor Image......Page 278
Figure 5.27. Danielsson Function Applied to a Binary Motor Image......Page 279
Figure 5.28. Labeling of Binary Images......Page 280
Figure 5.29. Diagram of Exercise 5.9......Page 281
Figure 5.31. Diagram of Exercise 5.10......Page 282
Circle Detection......Page 283
Figure 5.33. Circle Detection Exercise......Page 284
Figure 5.35. Diagram of Exercise 5.11......Page 286
Counting Objects......Page 289
Figure 5.37. Diagram of Exercise 5.12......Page 290
Measuring Distances (Clamping)......Page 291
Figure 5.38. Measuring Vertical Maximum Distances......Page 292
Figure 5.40. Measuring Horizontal Maximum Distances......Page 293
Figure 5.41. Measuring Horizontal Minimum Distances......Page 294
Complex Particle Measurements......Page 295
Figure 5.43. Diagram of Exercise 5.14......Page 296
Figure 5.45. Diagram of Exercise 5.15......Page 298
Figure 5.46. Calculating Other Complex Particle Parameters......Page 299
Figure 5.47. Diagram of Exercise 5.16......Page 300
Figure 5.48. Intercept and Chord Particle Measurements......Page 305
Image Calibration......Page 308
Figure 5.49. Calibrating the Motor Image......Page 309
Figure 5.51. Diagram of Exercise 5.17......Page 310
Figure 5.52. Grid Calibration with IMAQ Vision Builder......Page 311
Figure 5.53. Shape Matching with IMAQ Vision Builder......Page 312
Pattern Matching......Page 314
Figure 5.54. Pattern Matching with IMAQ Vision Builder......Page 315
Pattern Matching Techniques......Page 316
Figure 5.57. Part of the Pattern Matching Diagram......Page 317
Figure 5.58. Pattern Matching: Multiple Match......Page 318
Figure 5.60. Part of the Analog Meter Reading Diagram......Page 321
Figure 5.61. Reading a Digital LCD Instrument......Page 322
Figure 5.62. Part of the Digital LCD Reading Diagram......Page 323
Character Recognition......Page 324
Bar Code Reading......Page 325
Figure 5.65. Bar Code Reading Example (EAN 13 Setting)......Page 326
Figure 5.66. Focus Quality Rating with Edge Detection......Page 328
Figure 5.67. Focus Quality Diagram (Edge Detection)......Page 329
Figure 5.69. Focus Quality Diagram (Histogram Analysis)......Page 331
Figure 5.71. Focus Quality Diagram (FFT)......Page 333
Table 5.1. Comparison of Focus Quality Rating Metods......Page 334
Introduction......Page 335
IEEE 1394 (FireWire)......Page 336
The Moving Camera System......Page 337
Figure 5.74. Screenshot of a Typical Image Processing Application......Page 338
Moving Camera Software......Page 339
Object Detection and Counting in Public Places......Page 340
Fountain Control Hardware......Page 341
Figure 5.76. Villach City Hall Square with Interactive Fountain......Page 342
Object Detection Algorithms......Page 343
Figure 5.78. Principle of the Object Detection Algorithm......Page 344
Products Used......Page 345
Motivation......Page 346
The Layer Extraction Algorithm......Page 347
Figure 5.80. Diagram Window of the Layer Extraction Algorithm (Threshold Step)......Page 348
Figure 5.81. Visualization of NETQUEST Results in 2D and 3D View......Page 349
Figure 5.82. Feedback Form Prepared for Automatic Reading......Page 350
The Solution......Page 351
Functionality of the Form Reader Software......Page 352
Mark Detection Algorithm......Page 353
Figure 5.84. Block Diagram of find mark.vi......Page 354
Conclusion......Page 355
Application Papers:......Page 358
About the Author......Page 359