Sunday, 11 September 2016

Program for effect of reducing Image Quantization using Matlab

Program for effect of reducing Image Quantization using Matlab

 

The effects of reducing the number of bits to represent the gray levels in an image using uniform quantization. As fewer quantization levels are used, there is a progressive loss of spatial detail. Further more, certain artifacts such as contouring (or false contouring ) begin to appear.
Program:  

clc;
clear all;
close all;
a=imread('D:\sample.jpg');
b=rgb2gray(a);
c=double(b);
c=c+1;
d=max(max(c));
i=input('how many bits do you need :');
j=d/(2^i);
F=floor(c/(j+1));
F1=(F*255)/max(max(F));
figure(1);
imshow(uint8(b));
title('ORiginal Image')
figure(2);
imshow(uint8(F1));
title('Quantized image')

 

OUTPUT:
 
how many bits do you need :2
 


 



No comments:

Post a Comment