Back to Browse

Huffman Coding in Digital Image Processing with example & its Implementation in MATLAB ||Compression

12.6K views
Jul 17, 2022
13:52

Video lecture series on Digital Image Processing, Lecture: 39, Huffman coding in Digital Image Processing with example and its Implementation in MATLAB Coding redundancy Image Compression Link of Hindi Version of this lecture: https://youtu.be/HWIOSrM5fiE Link to download ppts/lecture notes: https://drive.google.com/drive/folders/1AtR1eq6ZvQf-5vjXEMUPXNj2S0d9rAMZ?usp=share_link #DIP #DIPwithMATLAB #DigitalImageProcessingUsingMATLAB #DigitalImageProcessing #StudywithDrDafda MATLAB code developed for the video... %Program for Huffman encoding and decoding close all; clear all; clc; I = imread('Cameraman.tif'); I = imresize(I, [4 NaN]); disp('the pixel values are:'); disp(I); % % % other example I values % I = [4 5 3 2 % 5 6 4 1 % 3 2 4 2 % 2 3 2 3]; % I = [ 3 3 3 2 % 2 3 3 3 % 3 2 2 2 % 2 1 1 0]; subplot(1,2,1); imshow(uint8(I)); title('Original image'); [m,n] = size(I); Totalcount=m*n; symbols = unique(I); disp('the unique symbols are'); disp(symbols); counts=histc(I(:),symbols); pro=counts./Totalcount; disp('the probabilities are:'); disp(pro); [dict,avglen]=huffmandict(symbols,pro); disp('the average length of the code is :'); disp(avglen); H=entropy(uint8(I)); disp('Entropy is:'); disp(H); E=(H/avglen)*100; disp('Efficiency is:'); disp(E); disp('Compression ratio is:'); Cr=(Totalcount*8)/(Totalcount*avglen) disp('Relative data redundancy is:'); RD = (1 - (1/Cr))*100 newvec=reshape(I.',1,[] ); hcode=huffmanenco(newvec,dict); disp('The Huffman encoded code is:'); disp(hcode); DD1=huffmandeco(hcode,dict); disp('The Huffman decoded code is:'); disp(DD1); DD=uint8(DD1); Restore=reshape(DD,4,4); subplot(1,2,2); imshow(Restore.'); title('Decoded Image');

Download

1 formats

Video Formats

360pmp420.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Huffman Coding in Digital Image Processing with example & its Implementation in MATLAB ||Compression | NatokHD