Professional Documents
Culture Documents
jpg'); subplot(2, 2, 1); imshow(imag); title('Original Image'); h=imhist(imag); subplot(2, 2, 2); bar(h); title('Hitogram of Original Image'); g=histeq(imag); subplot(2, 2, 3); imshow(g); title('Hitogram Equalization of Original Image'); l=imhist(g); subplot(2, 2, 4); bar(l); title('Hitogram of Equalized Image ');
Original Image 2000 1500 1000 500 0 Hitogram Equalization of Original Image 2000 1500 1000 500 0
100
200
300
100
200
300
clc; Image = imread('lena.jpg'); [rows columns numberOfColorBands] = size(Image); subplot(2, 2, 1); imshow(Image); title('Original Color Image'); redPlane = Image(:, :, 1); greenPlane = Image(:, :, 2); bluePlane = Image(:, :, 3);
pixelCountR = imhist(redPlane); subplot(2, 2, 2); bar(pixelCountR, 'r'); title('Histogram of red plane'); pixelCountG = imhist(greenPlane); subplot(2, 2, 3); bar(pixelCountG, 'g'); title('Histogram of green plane'); pixelCountB = imhist(bluePlane); subplot(2, 2, 4); bar(pixelCountB, 'b'); title('Histogram of blue plane');
imageeq=rgb2gray(Image); figure(); subplot(2, 2, 1); imshow(imageeq); title('Converted Image'); hist=imhist(imageeq); subplot(2, 2, 2); bar(hist); title('Histogram of Converted Image'); histe=histeq(imageeq); subplot(2, 2, 3); imshow(histe) title('Histogram Equalization'); histei=imhist(histe); subplot(2, 2, 4); bar(histei); title('Histogram of Equalized Image');
4000
2000
100
200
300
2000
100
200
300
100
200
300
2000
1000
100
200
300
4000
2000
100
200
300