Download presentation
Presentation is loading. Please wait.
1
Statistical Operations
Gray-level transformation Histogram equalization Multi-image operations Image Processing
2
Histogram If the number of pixels at each gray level in an image is counted (may use the following code fragment) for (row=0; row<rowmax; roww++) for (col=0; col=colmax; col++) { count[image[row,col]]++; } Image Processing
3
Histogram The array “count” can be plotted to represent a “histogram” of the image as the number of pixels at particular gray level The histogram can yield useful information about the nature of the image. An image may be too bright or too dark. Image Processing
4
Histogram Illustration
10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 Image Processing
5
Global Attenuation in Brightness
To alter the brightness of an image by adding or subtracting all pixel values with a constant for (row=0; row<rowmax; roww++) for (col=0; col=colmax; col++) { image[row,col] += constant; } Image Processing
6
Image Processing
7
Image Processing
8
Image Processing
9
Image Processing
10
Thresholding Use: Operation:
To remove the gray level trends in an image To make gray level more discrete To segment or split an image into distinct parts Operation: setting all gray levels below a certain level to “zero”, and above a certain level to a maximum brightness Image Processing
11
Code for Thresholding for (row=0; row<rowmax; roww++)
for (col=0; col=colmax; col++) { if (image[row,col] > threshold) image[row,col] = MAX; else image[row,col] = MIN; } Image Processing
12
Image Processing
13
Thresholding Errors Rarely is it possible to identify a perfect gray level break, what we want to be background pixels become foreground or vice versa Type 1: not all pixels caught that should be included Type 2: some pixels caught should not be included in the group Image Processing
14
An image before and after thresholding
Image Processing
15
Bunching (Quantizing)
Use: to reduce the number of different gray level in an image to segment an image to remove unwanted gray level degradation Operation: Close gray levels are combined, thus removing unwanted variations in data Image Processing
16
Bunching (Quantizing)
Method 1: inspecting histogram and combining close group into single gray level Method 2: identifying a set of gray levels allowed in the final image, then changing the gray level in every pixel to its nearest allowed value Image Processing
17
Bunching Example 0 **** 0 ****** 1 ** 1 2 ***** 2 3 *********
0 **** 1 ** 2 ***** 3 ********* 4 ***** 5 ***** 6 ***** 7 ***** 8 ********* 9 *** 0 ****** 1 2 3 ******************* 4 5 6 *************** 7 8 9 ************ Image Processing
18
Bunching Code for (row=0; row<rowmax; row++)
for (col=0; col<colmax; col++) { image[row,col] = bunchsize*((int)image[row,col]/bunchsize); } bunchsize = number of levels to be grouped into one Image Processing
19
Splittings Use: Operation:
to increase the different two groups of gray levels so that the contrast between segments compose of one group of the other is enhanced Operation: rounding the gray levels up if they are in the range and down if they are in another Image Processing
20
Splitting Example The characters on a car number-plate are at gray level 98 The background of the characters is at gray level 99 Pushing 98 down to 80 and pushing 99 up to 120 will give the picture a better contrast around the number plate Question: How to find a good splitting level? Image Processing
21
Automatic Selection of Splitting Level
Use: to find the best gray level for splitting--usually for thresholding to black and white Operation: Let Image Processing
22
Automatic Selection of Splitting Level
Let P=NxM = the number of pixels under consideration Let m(g) = mean gray level for only those pixels containing gray level between zero and g, i.e. If the maximum number of gray level is G (G=0,…,G-1) then evaluate the following equation (T = splitting threshold) A B Image Processing
23
Example Histogram f(g) t(g) g.f(g) Sg.f(g) m(g) A B A*B 0 **** 1 ** 2 ***** 3 ********* 4 ***** 5 ***** 6 ***** 7 ***** 8 ********* 9 *** INF- T = max(A*B) - 1 = 4 Image Processing
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.