Presentation is loading. Please wait.

Presentation is loading. Please wait.

TOPIC 11 THE GREY LEVEL HISTOGRAM & POINT OPERATIONS.

Similar presentations


Presentation on theme: "TOPIC 11 THE GREY LEVEL HISTOGRAM & POINT OPERATIONS."— Presentation transcript:

1 TOPIC 11 THE GREY LEVEL HISTOGRAM & POINT OPERATIONS

2

3 COM366 function BG = SetBackground(frame) %To use a particular frame as a the background filename = ['WhiteVan', int2str(frame), '.jpg'] I = imread(filename); GI = rgb2gray(I); imshow(GI); BG = double(GI)+1; %Extra line added to show the image histogram imhist(GI,255); Image Histogram in MATLAB

4

5

6

7

8 COM366 If a = 1 and b = 0 the image is simply copied If a>1 the contrast is increased and if a < 1 the contrast is decreased. If a = 1 and b is non zero then the output image has the grey levels moved up or down. Thus the entire image becomes darker or lighter. If a < 0 then light areas become dark and dark areas become light. In effect the image is complemented. Consequences of

9 COM366 Correcting sensor non linearity We can regard the sensor response as a function G which transforms the true pixel values to non linear values The sensor records G(D A ) a non linear distorted version of D A. Applying the inverse transform G -1 corrects for the distortion and restores the value D A.

10

11 COM366 Histogram equalisation N i is the number of pixels with brightness I T is the total number of pixels

12

13 COM366 function equalise %To show the effects of histogram equalisation J = imread('eyeball.jpg'); subplot(2,1,1);imshow(J); K = histeq(J); subplot(2,1,2);imshow(K); Histogram equalisation in MATLAB

14 Photometric calibration

15

16 COM366 Background subtraction (Background)(Scene)(Difference) |I 1 – I 2 |

17 COM366 function RoadSegment(frame,BG) % Takes an RGB image and segments out the vehicle content %This function assumes the background image BG is available filename = ['WhiteVan', int2str(frame), '.jpg'] I = imread(filename); GI = rgb2gray(I); A = double(GI)+1; C1 = A - BG; C = uint8(round(C1-1)); outfilename = ['SegVan', int2str(frame),'.JPG'] imwrite(C,outfilename,'jpg') imshow(C)

18 COM366 The principle of thresholding

19 COM366 function ThreshHold %To demonstrate thresholding an image J = imread('eyeball.jpg'); subplot(2,1,1);imshow(J); BW = im2bw(J,0.6); subplot(2,1,2);imshow(BW); Thresholding an image in MATLAB


Download ppt "TOPIC 11 THE GREY LEVEL HISTOGRAM & POINT OPERATIONS."

Similar presentations


Ads by Google