Technique 6: General gray-level transformations USE: To combine thresholding, bunching and splitting into one operation. This is also useful as a single tool in a set of software tools for image processing, since it does anyone of the technique on any part of the histogram. OPERATION: A function F(g) can be specified which transforms any gray level g to a new gray level q. Original histogram Final histogram F(g) transform 17/01/62 240-373 Image Processing
Histogram equalization Technique 7: Histogram equalization USE: To improve contrast of an image. Can be used on a whole image or just on a part of an image. THEORY: where G is total number of gray levels. OPERATION: if t(g) is the actual number of pixels at old gray level g or less, then 240-373 Image Processing, Lecture #6 17/01/62 240-373 Image Processing
Histogram equalization example 17/01/62 240-373 Image Processing
Example 17/01/62 240-373 Image Processing
Example 17/01/62 240-373 Image Processing
Multi-image operations Occasionally, it is useful to prepare a new image from a number of previous images. Example: white shape on white paper problem: difficult to distinguish between the shape and the paper due to bad lighting. solution 1: improve the lighting solution 2: capture an extra image of pure white paper without shape under the same lighting, then subtract the two images. Technique 8: Background subtraction USE: To remove light shading or discover movement from one image to another. THEORY: Gray level in each pixel in one image is subtracted from the gray level in the corresponding pixel in other image, i.e. result = x-y (x >= y) If x < y the result is negative: -1 is held as 255 -2 is held as 254 and so on 17/01/62 240-373 Image Processing
Technique 8 cont’d A better operation: result = | x - y | OPERATION: Collect both images. One image, x, should be on a pure background. The image with object will form image y. For each pixel calculate abs(x-y) This will give a negative image of the object. To return the image to a positive, use the following formula new image = MAX - abs(x-y) 17/01/62 240-373 Image Processing
17/01/62 240-373 Image Processing
Multi-image averaging A series of poor images of the same scene can be used to find a better image. Averaging or filtering can be used to enhance the picture. Multi-image modal filtering Chose the most popular gray level for each corresponding pixel in a sequence of images Multi-image median filtering Similar to modal filtering, except the middle value is chosen sorting is needed Multi-image averaging filtering Using a weighted averaging technique 17/01/62 240-373 Image Processing
Technique 9 Technique 9: Recursive filtering USE: To improve a sequence of still images--reducing noise by producing new images that correspond to weighted averages of previous images. OPERATION: It is assumed that newly collected images are available from a frame store with a fixed delay between each image. 1. Setting up: copy an image into a separate frame store, dividing all the gray levels by an integer, n. Add to that image n-1 subsequent images, the gray levels of which are also divided by n. You should now have the average of the first n images in the frame store. 2. Recursion: For every new image, multiply the contents of the frame store by (n-1)/n and the new image by 1/n, add them together and put the result back into the frame store. THEORY: At setup the frame store contains 17/01/62 240-373 Image Processing
Recursive filtering cont’d Then after many images the following steady state is created: n=10 n=5 n=2 new one 0.100 0.200 0.500 last one 0.090 0.128 0.250 last but 1 0.081 0.102 0.125 last but 2 0.073 0.080 0.063 last but 3 0.066 0.066 0.031 last but 4 0.059 0.052 0.016 last but 5 0.053 0.042 0.008 last but 6 0.048 0.034 0.004 last but 7 0.043 0.027 0.002 last but 8 0.039 0.021 0.001 last but 9 0.035 0.017 0.000 and so on 17/01/62 240-373 Image Processing