Computer Vision & Image Processing
Computer Vision & Image Processing
john@hulskamp.com.au
Introduction
Introducing the new subject 31049 Computer Vision & Image Processing Guest Lecturer with previous experience in teaching & research in the area
john@hulskamp.com.au
Osteons
Compact bone is comprised of many units called osteons: they consist of a central canal surrounded by closely packed concentric layers called lamallae. This is an image of some osteons, specimen is from a 32yo male. Image is a ~2.8x3.5mm portion of a contact micro-radiograph taken from a 100micrometre thick, un-embedded, hard-ground section. Black areas are voids, white = high mineral density (maybe a couple of grains of carborundum can be seen). Attribution: David Thomas, Dental Sciences, University of Melbourne
john@hulskamp.com.au
Near IR Imaging
john@hulskamp.com.au
Thermal Map Attribution: C. Lampe: A Multi-Processor temperature profiling system for real time control in a hot strip rolling mill M.Eng. Thesis RMIT 1995
john@hulskamp.com.au
Subject objectives Fundamental Issues Applications Towards image understanding CV & IP Tools A Simple Beginning Conclusions
john@hulskamp.com.au
Subject objectives
adequate background knowledge about computer vision and image processing practical knowledge and skills about computer vision and image processing tools necessary knowledge to design and implement a prototype of a computer vision application
john@hulskamp.com.au
Fundamental Issues
An imaging system
john@hulskamp.com.au
Sensor size - the size of a sensor's active area Depth of field - the maximum object depth that
remains in focus
john@hulskamp.com.au
Resolution indicates the amount of object detail that the imaging system can reproduce. You can determine the required resolution of your imaging system by measuring in real-world units the size of the smallest feature you need to detect in the image. To make accurate measurements, a minimum of two pixels should represent the smallest feature you want to detect in the digitized image. In the picture , the narrowest vertical bar (w) should be at least two pixels wide in the image. This information can assist to select the appropriate camera and lens for the imaging application.
john@hulskamp.com.au
10
Sensor resolution is the number of columns and rows of CCD pixels in the
camera sensor. To compute the sensor resolution, you need to know the field of view (FOV). The FOV is the area under inspection that the camera can acquire. The horizontal and vertical dimensions of the inspection area determine the FOV. Make sure the FOV encloses the object you want to inspect. Once you know the FOV, you can use the following equation to determine your required sensor resolution: sensor resolution = (FOV/resolution) x 2 = (FOV/size of smallest feature) x 2
john@hulskamp.com.au
11
john@hulskamp.com.au
12
john@hulskamp.com.au
13
Backlighting is another lighting technique that can help improve the performance of your vision system. If you can solve your application by looking at only the shape of the object, you may want to create a silhouette of the object by placing the light source behind the object you are imaging. By lighting the object from behind, you create sharp contrasts which make finding edges and measuring distances fast and easy. This picture shows a stamped metal part acquired in a setup using backlighting.
john@hulskamp.com.au
14
john@hulskamp.com.au
15
Try to position your camera perpendicular to the object under inspection to reduce perspective errors. Integration constraints may prevent you from mounting the camera perpendicular to the scene. Under these constraints, you can still take precise measurements by correcting the perspective errors with spatial calibration techniques.
john@hulskamp.com.au
16
Examples:
Battery Clamp Spark Plug Gap Measurement Blister Pack Inspection PCB Inspection
john@hulskamp.com.au
17
Battery Clamp
john@hulskamp.com.au
18
john@hulskamp.com.au
19
Blister Pack Inspection: Ensuring that blister packs contain the correct
number and type of pills before they reach pharmacies, ensuring the integrity of the product and increase the yield of production by automating the inspection of blister pack contents.
Acquire colour images of the blister packs. Use colour location to count the number of green areas in the image. With colour location, you create a model or template that represents the colours that you are searching. Then the machine vision application searches for the model in each acquired image and calculates a score for each match. The surface area of each pill in the pack must be at least 50% green to pass inspection.
john@hulskamp.com.au
20
john@hulskamp.com.au
21
PCB Inspection To ensure that components are present and at the correct orientation on a PCB.
john@hulskamp.com.au
22
john@hulskamp.com.au
23
Computer Vision: making useful decisions about real physical objects and scenes based on sensed images To get to that understanding we need to process images: hence Image Processing is a step towards this understanding Image Processing issues: Image Statistics & Histograms Image Enhancement Image Restoration Image Analysis: Edge Detection & Feature extraction Representation & Description Pattern Recognition
john@hulskamp.com.au
24
Histograms
The cumulative histogram of a grey-level image f(w,h) is a function H(k) which provides the total number pixels (number of occurrences) that have grey-level less than the value k.
H (k ) ! card { f ( w, h) | f ( w, h) k} k [0, k max ] ( w, h) [(0,0), (W 1, H 1)]
Where card stands for the cardinality (i.e. number of pixels) of a set. The histogram of a grey-level image f(w,h) is a table h(k) which is the discrete difference of the cumulative histogram. It provides the total number pixels (number of occurrences) that have a specific grey-level value k. Attribution: www.khoral.com
h(k ) ! H (k ) H (k 1)
john@hulskamp.com.au 25
Histograms (2)
john@hulskamp.com.au
26
Histogram Equalisation
john@hulskamp.com.au
27
CV & IP Tools
NIH Image is a public domain image processing and analysis program for the Macintosh. It was developed at the Research Services Branch (RSB) of the National Institute of Mental Health (NIMH), part of the National Institutes of Health (NIH). A free PC version of Image, called Scion Image for Windows, is available from Scion Corporation. Image can acquire, display, edit, enhance, analyse and animate images. It reads and writes TIFF, PICT, PICS and MacPaint files, providing compatibility with many other applications, including programs for scanning, processing, editing, publishing and analysing images. It supports many standard image processing functions, including contrast enhancement, density profiling, smoothing, sharpening, edge detection, median filtering, and spatial convolution with user defined kernels. Image can be used to measure area, mean, centroid, perimeter, etc. of user defined regions of interest. It also performs automated particle analysis and provides tools for measuring path lengths and angles. Spatial calibration is supported to provide real world area and length measurements. Density calibration can be done against radiation or optical density standards using user specified units. Results can be printed, exported to text files, or copied to the Clipboard.
john@hulskamp.com.au
28
Khoral Inc:It started out as Khoros about 10 years ago, for UNIXbased X-systems, has become available for the Windows platform as well. Costs money today! Their online DIP course is very good: http://www.khoral.com/contrib/contrib/dip2001/index.html
john@hulskamp.com.au
29
UTHSCSA ImageTool
UTHSCSA ImageTool (IT) is a free image processing and analysis program for Microsoft Windows 9x, Windows ME or Windows NT. IT can acquire, display, edit, analyse, process, compress, save and print gray scale and colour images.IT can read and write over 22 common file formats including BMP, PCX, TIF, GIF and JPEG. Image analysis functions include dimensional (distance, angle, perimeter, area) and gray scale measurements (point, line and area histogram with statistics). ImageTool supports standard image processing functions such as contrast manipulation, sharpening, smoothing, edge detection, median filtering and spatial convolutions with user-defined convolution masks. ImageTool was designed with an open architecture that provides extensibility via a variety of plug-ins. Support for image acquisition using either Adobe Photoshop plug-ins or Twain scanners is built-in. Custom analysis and processing plug-ins can be developed using the software development kit (SDK) provided (with source code). This approach makes it possible to solve almost any data acquisition or analysis problem with IT.
john@hulskamp.com.au
30
Intel open source computer vision library OpenCV CVIPtools: is a UNIX/Win32-based software package developed \ under the continuing direction of Dr. Scott E Umbaugh One of the primary purposes of the CVIPtools development is to allow students, faculty, and other researchers to explore the power of computer processing of digital images. CVIPtools is a collection of computer imaging tools providing services to the users at three layers. At the bottom level are the CVIPtools libraries (the application programming interface). Based on the CVIPtools libraries are the cviptcl and cvipwish shells. The cviptcl shell is an extension of Tcl with additional CVIP capabilities. With cviptcl, the user can either use the command line for interactive image processing, or write cviptcl shell scripts for batch processing. The cvipwish shell is the extension of cviptcl with the added functionality for building a graphical user interface (GUI) which allows even the casual computer users to experiment with many of the sophisticated tools available to computer imaging specialists without the need for any knowledge of computer programming.
john@hulskamp.com.au
31
Topics in Course
Image formation. Human vision. Computer vision. Image representation. Analog and digital images. Common image and video formats. Image compression. JPEG and MPEG. Image acquisition. Image acquisition systems. Cameras and frame grabbers. Image processing. Image enhancement. Convolution. Filtering. Edge detection. Texture analysis. Labelling. Contour tracing. Image morphology. Image segmentation. Image analysis. Feature extraction. Geometrical features. Hough transform. Image sequences. Motion detection. Optical flow. Background subtraction. Feature tracking. Pattern recognition. Object classification. Statistical, neural networks, symbolic classifiers. Computer Vision. Model-based vision. Applications in industrial quality inspection, video surveillance, robotics, medicine, multimedia .
john@hulskamp.com.au
32
A Simple Beginning
Conclusions
An overview of what is ahead for you in this exciting field. You might like to experiment with the above simple code to attempt to gain the histogram for an image, and try out histogram equalisation
john@hulskamp.com.au
34