Image processing in MATLAB (code in description) to reducing quantization levels is the content of this video. Moreover, how to do Image Analysis and Quantization of an image as a Matlab tutorial is shown in this video. Specifically, we reduce the Quantization levels (L) of an given image from L = 256 to L=8 and L = 4. Lastly, a montage based plot is used to display results.
#Quantization #ImageProcessing #MATLAB
%Ahmad Kamal Hassan
%%% For further information, refer to
%%% https://www.mathworks.com/help/images...,
clc
close all
clear all
figure(1)
I = imread('Picture.jpg');
imshow(I)
axis off
title('Original Image')
Quantization_level = max(I(:));
keyboard
%Qunatization Level Reduction to 8
thresh8 = multithresh(I,7);
valuesMax8 = [thresh8 max(I(:))]
[quant8_I_max, index] = imquantize(I,thresh8,valuesMax8);
valuesMin8 = [min(I(:)) thresh8];
quant8_I_min = valuesMin8(index);
%Qunatization Level Reduction to 4
thresh4 = multithresh(I,3);
valuesMax4 = [thresh4 max(I(:))]
[quant4_I_max, index] = imquantize(I,thresh4,valuesMax4);
valuesMin3 = [min(I(:)) thresh4]
quant4_I_min = valuesMin3(index);
keyboard
figure(2)
multi = cat(4,quant8_I_min,quant8_I_max,quant4_I_min,quant4_I_max);
montage(multi); % montage plot
title('Minimum Interval Value Maximum Interval Value')
ylabel('L = 4 L = 8')