SlideShare a Scribd company logo
Penn State Harrisburg
Digital Image Processing
Image Compression using DCT
Chad RyanWeiss
4/25/2016
Abstract:
Image compressionhasbecome the mostimportant,energyefficiencymethodfortransferringvideos
and imagesviaany communicationsystem. Before some of the veryfirstimage compressiontechniques
were everestablished,itwouldtake hourstoupload,download,file share andtransmitmediafiles
because the file sizeswere toobig. Evenwiththe 4G technologythatwe have today, these tremendous
file sizeswouldstillpose amajorproblemtomemorystorage systems. Since the dawnof the early
digital image processingdays,scientistsandmathematicianshave beencomingupwithcleverwaysto
compressimagesandframes foreasystorage and data transfer. Methodslike the discrete cosine
transformuse highlyadvancedmathematical principlestorepresentimagesthatallow formodification
and cleversize manipulationof the overall image. Byimplementingdigital image processingtechniques
like the discrete cosine transform,one wouldessentiallymake the packetof informationalotlighterfor
transportand storage.
Theory:
The discrete cosine transform(DCT) isa methodthatrepresentsanimage asa sum of sinusoidsof
varyingmagnitudesandfrequencies. Itisthisrepresentationof the image asa sumof sinusoidsthat
allowsforthe fact that mostof the visuallysignificantinformationaboutthe image isconcentratedin
the DCT coefficients. Forthisreason,DCT hasbecome a well-known,popularimage compression
standardfor lossyimage compression. Animportantqualityaboutthe DCTisthat it isinvertible,which
isconvenientforthe realmof image compressionbecause itissometimesnecessaryandrecoverthe
original image forthe sake of acquiringthe primarysource of information.
Whencompressinganimage usingDCT,the image inputisfirstdividedinto8by 8 or 16 by16 blocks
and thenthe DCT is computedforeachblockof information. The coefficientsof the DCTtransformare
thenobtained,quantized,codedandtransmitted. Once the transmitterhasessentiallytransferredall of
the informationandthe receiverhaspickedupthe signal,the receiverbeginstodecode the quantized
coefficients,computesthe inverse DCTof eachblockand thenreconstructsthe original image.
The reasonthe DCT iscalleda lossymethodforcompressingimagesisdue tothe fact that many of
these coefficientsare nearlyzeroandholdnot-so-importantinformationinregardstothe bigpicture.
These valuesare simple thrownoutbecause theycanbe andthe image becomessmaller. Usually,the
userhas no ideathatthese have been thrownoutbecause of how small orinsignificantthese partsof
the image were tothe overall whole.
Example Code:
clear all; close all; clc;
I = imread('NASA.jpg');
I=double(I(:,:,1))/255;
T = dctmtx(8);
B = blkproc(I,[8 8],'P1*x*P2',T,T');
mask = [1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blkproc(B,[8 8],'P1.*x',mask);
I2 = blkproc(B2,[8 8],'P1*x*P2',T',T);
imtool(I);
imtool(I2);
The code seenatleftwill compressa
two-dimensional imageusingthe DCT.
We start byreadinginan image using
the imreadfunction. Followingthis
immediate actionwe thenconvertthe
image to data type double andscale it
downto account forthisdata shift.
Next,we create a DCT coefficient
matrix usingthe dctmtx function,which
will be usedinthe precedinglinesof
code to pre andpost multiply the 8-by-
8 blocksof data of ourimage.The
blkprocfunctioncreatesthe 8-by-8
chunksof data andallowsusto throw
inthe pre and postmultiplicationas
part of the function’sinputarguments.
Finallywe decide whichcoefficientsto
keepbyapplyingthe maskandthen
applyingthe inverseDCTto recoverthe
image anddisplaythe outputs.(NEXT)
Figure 1 representsthe original image. Aftersavingthisimage tothe desktop,the size of thisoriginal
file wasfoundtocontain 33.8 kb of data. Now we will determinethe compressionratioof this
particularexample byreferringtothe nextimage.
Figure 1: Original Image
Figure 2 representsthe compressedimage. Itcan be seenthatsome of the finerdetailshave been
blurredor leftoutentirely. Aftersavingthisfile tothe desktop,the file sizewasfoundtobe only13 kb!
The DCT yieldedacompressionratioof aboutC = 33.8 kb/ 13 kb= 2.6!
Figure 2: Compressed Image
Conclusion:
In summary,we talkedabouthowthe DCT isusedin digital image processingaswell as the implications
of image compression. We brieflytalkedaboutsome of the theory behind the DCT and found that a lot
of itis basedonhighlyadvancedmathematical andscientificconcepts. Lastly, we provided an example
of the DCT image compression techniques sing MatLab. The results were displayed and we found for
our particularexample thatthe outputimage was compressed by a factor of 2.6 without any major loss
of information as to what the big picture actual represents.

More Related Content

What's hot

Design of Image Compression Algorithm using MATLAB
Design of Image Compression Algorithm using MATLABDesign of Image Compression Algorithm using MATLAB
Design of Image Compression Algorithm using MATLAB
IJEEE
 
D0325016021
D0325016021D0325016021
D0325016021
theijes
 
Introductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT RoorkeeIntroductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT Roorkee
Vinayak Sahai
 
Ec section
Ec section Ec section
Ec section
Antriksh Saxena
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
Hossain Md Shakhawat
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
Aishwarya K. M.
 
Image compression introductory presentation
Image compression introductory presentationImage compression introductory presentation
Image compression introductory presentation
Tariq Abbas
 
Image compression using discrete wavelet transform
Image compression using discrete wavelet transformImage compression using discrete wavelet transform
Image compression using discrete wavelet transform
Harshal Ladhe
 
Traffic sign classification
Traffic sign classificationTraffic sign classification
Traffic sign classification
Bill Kromydas
 
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Majd Khaleel
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
Mazin Alwaaly
 
Project presentation image compression by manish myst, ssgbcoet
Project presentation image compression by manish myst, ssgbcoetProject presentation image compression by manish myst, ssgbcoet
Project presentation image compression by manish myst, ssgbcoet
Manish Myst
 
Lossless Huffman coding image compression implementation in spatial domain by...
Lossless Huffman coding image compression implementation in spatial domain by...Lossless Huffman coding image compression implementation in spatial domain by...
Lossless Huffman coding image compression implementation in spatial domain by...
IRJET Journal
 
Image Compression using DPCM with LMS Algorithm
Image Compression using DPCM with LMS AlgorithmImage Compression using DPCM with LMS Algorithm
Image Compression using DPCM with LMS Algorithm
IRJET Journal
 
Introduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab ToolboxIntroduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab Toolbox
Shahriar Yazdipour
 
Discrete cosine transform
Discrete cosine transform   Discrete cosine transform
Discrete cosine transform
Rashmi Karkra
 
Jpeg dct
Jpeg dctJpeg dct
Jpeg dct
darshan2518
 
//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats
Rosa ɯǝukɯɐn
 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
theem college of engineering
 
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
arpublication
 

What's hot (20)

Design of Image Compression Algorithm using MATLAB
Design of Image Compression Algorithm using MATLABDesign of Image Compression Algorithm using MATLAB
Design of Image Compression Algorithm using MATLAB
 
D0325016021
D0325016021D0325016021
D0325016021
 
Introductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT RoorkeeIntroductory Digital Image Processing using Matlab, IIT Roorkee
Introductory Digital Image Processing using Matlab, IIT Roorkee
 
Ec section
Ec section Ec section
Ec section
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Image compression introductory presentation
Image compression introductory presentationImage compression introductory presentation
Image compression introductory presentation
 
Image compression using discrete wavelet transform
Image compression using discrete wavelet transformImage compression using discrete wavelet transform
Image compression using discrete wavelet transform
 
Traffic sign classification
Traffic sign classificationTraffic sign classification
Traffic sign classification
 
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
Image Processing using Matlab ( using a built in Matlab function(Histogram eq...
 
Multimedia image compression standards
Multimedia image compression standardsMultimedia image compression standards
Multimedia image compression standards
 
Project presentation image compression by manish myst, ssgbcoet
Project presentation image compression by manish myst, ssgbcoetProject presentation image compression by manish myst, ssgbcoet
Project presentation image compression by manish myst, ssgbcoet
 
Lossless Huffman coding image compression implementation in spatial domain by...
Lossless Huffman coding image compression implementation in spatial domain by...Lossless Huffman coding image compression implementation in spatial domain by...
Lossless Huffman coding image compression implementation in spatial domain by...
 
Image Compression using DPCM with LMS Algorithm
Image Compression using DPCM with LMS AlgorithmImage Compression using DPCM with LMS Algorithm
Image Compression using DPCM with LMS Algorithm
 
Introduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab ToolboxIntroduction in Image Processing Matlab Toolbox
Introduction in Image Processing Matlab Toolbox
 
Discrete cosine transform
Discrete cosine transform   Discrete cosine transform
Discrete cosine transform
 
Jpeg dct
Jpeg dctJpeg dct
Jpeg dct
 
//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats//STEIM Workshop: A Vernacular of File Formats
//STEIM Workshop: A Vernacular of File Formats
 
Image compression and jpeg
Image compression and jpegImage compression and jpeg
Image compression and jpeg
 
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
A Low Hardware Complex Bilinear Interpolation Algorithm of Image Scaling for ...
 

Viewers also liked

An efficient image compression algorithm using dct biorthogonal wavelet trans...
An efficient image compression algorithm using dct biorthogonal wavelet trans...An efficient image compression algorithm using dct biorthogonal wavelet trans...
An efficient image compression algorithm using dct biorthogonal wavelet trans...
eSAT Journals
 
Image compression
Image compressionImage compression
Image compression
Ale Johnsan
 
Image Compression
Image CompressionImage Compression
Image Compression
Paramjeet Singh Jamwal
 
Image compression
Image compressionImage compression
Image compression
partha pratim deb
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
Shivangi Saxena
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
LinkedIn
 

Viewers also liked (6)

An efficient image compression algorithm using dct biorthogonal wavelet trans...
An efficient image compression algorithm using dct biorthogonal wavelet trans...An efficient image compression algorithm using dct biorthogonal wavelet trans...
An efficient image compression algorithm using dct biorthogonal wavelet trans...
 
Image compression
Image compressionImage compression
Image compression
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Image compression
Image compressionImage compression
Image compression
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
 

Similar to Project004

Digital Image Compression using Hybrid Scheme using DWT and Quantization wit...
Digital Image Compression using Hybrid Scheme using DWT  and Quantization wit...Digital Image Compression using Hybrid Scheme using DWT  and Quantization wit...
Digital Image Compression using Hybrid Scheme using DWT and Quantization wit...
IRJET Journal
 
Efficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random PermutationEfficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random Permutation
IJERA Editor
 
Efficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random PermutationEfficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random Permutation
IJERA Editor
 
Kassem2009
Kassem2009Kassem2009
Kassem2009
lazchi
 
Iaetsd implementation of chaotic algorithm for secure image
Iaetsd implementation of chaotic algorithm for secure imageIaetsd implementation of chaotic algorithm for secure image
Iaetsd implementation of chaotic algorithm for secure image
Iaetsd Iaetsd
 
Intelligent Parallel Processing and Compound Image Compression
Intelligent Parallel Processing and Compound Image CompressionIntelligent Parallel Processing and Compound Image Compression
Intelligent Parallel Processing and Compound Image Compression
DR.P.S.JAGADEESH KUMAR
 
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
Secure Image Transmission for Cloud Storage System Using Hybrid SchemeSecure Image Transmission for Cloud Storage System Using Hybrid Scheme
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
IJERD Editor
 
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHERSELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
cscpconf
 
Selective image encryption using
Selective image encryption usingSelective image encryption using
Selective image encryption using
csandit
 
Implementation of bpcs steganography (synopsis)
Implementation of bpcs steganography (synopsis)Implementation of bpcs steganography (synopsis)
Implementation of bpcs steganography (synopsis)
Mumbai Academisc
 
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD Editor
 
Application of bpcs steganography to wavelet compressed video (synopsis)
Application of bpcs steganography to wavelet compressed video (synopsis)Application of bpcs steganography to wavelet compressed video (synopsis)
Application of bpcs steganography to wavelet compressed video (synopsis)
Mumbai Academisc
 
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
Associate Professor in VSB Coimbatore
 
An35225228
An35225228An35225228
An35225228
IJERA Editor
 
I1803035762
I1803035762I1803035762
I1803035762
IOSR Journals
 
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUESELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
ijcisjournal
 
Image Encryption in java ppt.
Image Encryption in java ppt.Image Encryption in java ppt.
Image Encryption in java ppt.
Pradeep Vishwakarma
 
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
IJNSA Journal
 
Comparative Study between DCT and Wavelet Transform Based Image Compression A...
Comparative Study between DCT and Wavelet Transform Based Image Compression A...Comparative Study between DCT and Wavelet Transform Based Image Compression A...
Comparative Study between DCT and Wavelet Transform Based Image Compression A...
IOSR Journals
 
I017125357
I017125357I017125357
I017125357
IOSR Journals
 

Similar to Project004 (20)

Digital Image Compression using Hybrid Scheme using DWT and Quantization wit...
Digital Image Compression using Hybrid Scheme using DWT  and Quantization wit...Digital Image Compression using Hybrid Scheme using DWT  and Quantization wit...
Digital Image Compression using Hybrid Scheme using DWT and Quantization wit...
 
Efficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random PermutationEfficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random Permutation
 
Efficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random PermutationEfficient Image Compression Technique using Clustering and Random Permutation
Efficient Image Compression Technique using Clustering and Random Permutation
 
Kassem2009
Kassem2009Kassem2009
Kassem2009
 
Iaetsd implementation of chaotic algorithm for secure image
Iaetsd implementation of chaotic algorithm for secure imageIaetsd implementation of chaotic algorithm for secure image
Iaetsd implementation of chaotic algorithm for secure image
 
Intelligent Parallel Processing and Compound Image Compression
Intelligent Parallel Processing and Compound Image CompressionIntelligent Parallel Processing and Compound Image Compression
Intelligent Parallel Processing and Compound Image Compression
 
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
Secure Image Transmission for Cloud Storage System Using Hybrid SchemeSecure Image Transmission for Cloud Storage System Using Hybrid Scheme
Secure Image Transmission for Cloud Storage System Using Hybrid Scheme
 
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHERSELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
SELECTIVE IMAGE ENCRYPTION USING DCT WITH AES CIPHER
 
Selective image encryption using
Selective image encryption usingSelective image encryption using
Selective image encryption using
 
Implementation of bpcs steganography (synopsis)
Implementation of bpcs steganography (synopsis)Implementation of bpcs steganography (synopsis)
Implementation of bpcs steganography (synopsis)
 
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
 
Application of bpcs steganography to wavelet compressed video (synopsis)
Application of bpcs steganography to wavelet compressed video (synopsis)Application of bpcs steganography to wavelet compressed video (synopsis)
Application of bpcs steganography to wavelet compressed video (synopsis)
 
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
Medical Image Compression using DCT with Entropy Encoding and Huffman on MRI ...
 
An35225228
An35225228An35225228
An35225228
 
I1803035762
I1803035762I1803035762
I1803035762
 
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUESELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
SELECTIVE ENCRYPTION OF IMAGE BY NUMBER MAZE TECHNIQUE
 
Image Encryption in java ppt.
Image Encryption in java ppt.Image Encryption in java ppt.
Image Encryption in java ppt.
 
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
AN EFFICIENT M-ARY QIM DATA HIDING ALGORITHM FOR THE APPLICATION TO IMAGE ERR...
 
Comparative Study between DCT and Wavelet Transform Based Image Compression A...
Comparative Study between DCT and Wavelet Transform Based Image Compression A...Comparative Study between DCT and Wavelet Transform Based Image Compression A...
Comparative Study between DCT and Wavelet Transform Based Image Compression A...
 
I017125357
I017125357I017125357
I017125357
 

More from Chad Weiss

Advancing Sustainability
Advancing SustainabilityAdvancing Sustainability
Advancing Sustainability
Chad Weiss
 
PLC Building Automation and Control Systems
PLC Building Automation and Control SystemsPLC Building Automation and Control Systems
PLC Building Automation and Control Systems
Chad Weiss
 
Solar Panel Installations
Solar Panel InstallationsSolar Panel Installations
Solar Panel Installations
Chad Weiss
 
Recommendation Report
Recommendation ReportRecommendation Report
Recommendation Report
Chad Weiss
 
Remote Sensing
Remote SensingRemote Sensing
Remote Sensing
Chad Weiss
 
Advancing Sustainability
Advancing SustainabilityAdvancing Sustainability
Advancing Sustainability
Chad Weiss
 
Final Project
Final ProjectFinal Project
Final Project
Chad Weiss
 
Mballa_Weiss_Lab6
Mballa_Weiss_Lab6Mballa_Weiss_Lab6
Mballa_Weiss_Lab6
Chad Weiss
 
Lab 3
Lab 3Lab 3
Lab 3
Chad Weiss
 
E E 481 Lab 1
E E 481 Lab 1E E 481 Lab 1
E E 481 Lab 1
Chad Weiss
 
Final Project
Final ProjectFinal Project
Final Project
Chad Weiss
 
E E 458 Project 003
E E 458 Project 003E E 458 Project 003
E E 458 Project 003
Chad Weiss
 
E E 458 Project 002
E E 458 Project 002E E 458 Project 002
E E 458 Project 002
Chad Weiss
 
Final Paper
Final PaperFinal Paper
Final Paper
Chad Weiss
 
Final Project
Final ProjectFinal Project
Final Project
Chad Weiss
 

More from Chad Weiss (15)

Advancing Sustainability
Advancing SustainabilityAdvancing Sustainability
Advancing Sustainability
 
PLC Building Automation and Control Systems
PLC Building Automation and Control SystemsPLC Building Automation and Control Systems
PLC Building Automation and Control Systems
 
Solar Panel Installations
Solar Panel InstallationsSolar Panel Installations
Solar Panel Installations
 
Recommendation Report
Recommendation ReportRecommendation Report
Recommendation Report
 
Remote Sensing
Remote SensingRemote Sensing
Remote Sensing
 
Advancing Sustainability
Advancing SustainabilityAdvancing Sustainability
Advancing Sustainability
 
Final Project
Final ProjectFinal Project
Final Project
 
Mballa_Weiss_Lab6
Mballa_Weiss_Lab6Mballa_Weiss_Lab6
Mballa_Weiss_Lab6
 
Lab 3
Lab 3Lab 3
Lab 3
 
E E 481 Lab 1
E E 481 Lab 1E E 481 Lab 1
E E 481 Lab 1
 
Final Project
Final ProjectFinal Project
Final Project
 
E E 458 Project 003
E E 458 Project 003E E 458 Project 003
E E 458 Project 003
 
E E 458 Project 002
E E 458 Project 002E E 458 Project 002
E E 458 Project 002
 
Final Paper
Final PaperFinal Paper
Final Paper
 
Final Project
Final ProjectFinal Project
Final Project
 

Project004

  • 1. Penn State Harrisburg Digital Image Processing Image Compression using DCT Chad RyanWeiss 4/25/2016
  • 2. Abstract: Image compressionhasbecome the mostimportant,energyefficiencymethodfortransferringvideos and imagesviaany communicationsystem. Before some of the veryfirstimage compressiontechniques were everestablished,itwouldtake hourstoupload,download,file share andtransmitmediafiles because the file sizeswere toobig. Evenwiththe 4G technologythatwe have today, these tremendous file sizeswouldstillpose amajorproblemtomemorystorage systems. Since the dawnof the early digital image processingdays,scientistsandmathematicianshave beencomingupwithcleverwaysto compressimagesandframes foreasystorage and data transfer. Methodslike the discrete cosine transformuse highlyadvancedmathematical principlestorepresentimagesthatallow formodification and cleversize manipulationof the overall image. Byimplementingdigital image processingtechniques like the discrete cosine transform,one wouldessentiallymake the packetof informationalotlighterfor transportand storage.
  • 3. Theory: The discrete cosine transform(DCT) isa methodthatrepresentsanimage asa sum of sinusoidsof varyingmagnitudesandfrequencies. Itisthisrepresentationof the image asa sumof sinusoidsthat allowsforthe fact that mostof the visuallysignificantinformationaboutthe image isconcentratedin the DCT coefficients. Forthisreason,DCT hasbecome a well-known,popularimage compression standardfor lossyimage compression. Animportantqualityaboutthe DCTisthat it isinvertible,which isconvenientforthe realmof image compressionbecause itissometimesnecessaryandrecoverthe original image forthe sake of acquiringthe primarysource of information. Whencompressinganimage usingDCT,the image inputisfirstdividedinto8by 8 or 16 by16 blocks and thenthe DCT is computedforeachblockof information. The coefficientsof the DCTtransformare thenobtained,quantized,codedandtransmitted. Once the transmitterhasessentiallytransferredall of the informationandthe receiverhaspickedupthe signal,the receiverbeginstodecode the quantized coefficients,computesthe inverse DCTof eachblockand thenreconstructsthe original image. The reasonthe DCT iscalleda lossymethodforcompressingimagesisdue tothe fact that many of these coefficientsare nearlyzeroandholdnot-so-importantinformationinregardstothe bigpicture. These valuesare simple thrownoutbecause theycanbe andthe image becomessmaller. Usually,the userhas no ideathatthese have been thrownoutbecause of how small orinsignificantthese partsof the image were tothe overall whole. Example Code: clear all; close all; clc; I = imread('NASA.jpg'); I=double(I(:,:,1))/255; T = dctmtx(8); B = blkproc(I,[8 8],'P1*x*P2',T,T'); mask = [1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; B2 = blkproc(B,[8 8],'P1.*x',mask); I2 = blkproc(B2,[8 8],'P1*x*P2',T',T); imtool(I); imtool(I2); The code seenatleftwill compressa two-dimensional imageusingthe DCT. We start byreadinginan image using the imreadfunction. Followingthis immediate actionwe thenconvertthe image to data type double andscale it downto account forthisdata shift. Next,we create a DCT coefficient matrix usingthe dctmtx function,which will be usedinthe precedinglinesof code to pre andpost multiply the 8-by- 8 blocksof data of ourimage.The blkprocfunctioncreatesthe 8-by-8 chunksof data andallowsusto throw inthe pre and postmultiplicationas part of the function’sinputarguments. Finallywe decide whichcoefficientsto keepbyapplyingthe maskandthen applyingthe inverseDCTto recoverthe image anddisplaythe outputs.(NEXT)
  • 4. Figure 1 representsthe original image. Aftersavingthisimage tothe desktop,the size of thisoriginal file wasfoundtocontain 33.8 kb of data. Now we will determinethe compressionratioof this particularexample byreferringtothe nextimage. Figure 1: Original Image
  • 5. Figure 2 representsthe compressedimage. Itcan be seenthatsome of the finerdetailshave been blurredor leftoutentirely. Aftersavingthisfile tothe desktop,the file sizewasfoundtobe only13 kb! The DCT yieldedacompressionratioof aboutC = 33.8 kb/ 13 kb= 2.6! Figure 2: Compressed Image
  • 6. Conclusion: In summary,we talkedabouthowthe DCT isusedin digital image processingaswell as the implications of image compression. We brieflytalkedaboutsome of the theory behind the DCT and found that a lot of itis basedonhighlyadvancedmathematical andscientificconcepts. Lastly, we provided an example of the DCT image compression techniques sing MatLab. The results were displayed and we found for our particularexample thatthe outputimage was compressed by a factor of 2.6 without any major loss of information as to what the big picture actual represents.