SlideShare a Scribd company logo
1 of 2
Download to read offline
Discrete Cosine Transforms
The discrete cosine transform (DCT) is another frequently used transform in image processing. An advantage of DCT
over DFT is that DCT does not involve complex computations. The equations for DCT and inverse DCT are shown
below:
NAME
dct2 - performs 2D-DCT of an input image and returns the transformed image to the user.
SYNOPSIS
dct2(input_file_name)
dct2(input_file_name, [mrows, ncols])
dct2(input_file_name, mrows, ncols)
mrows --pads or crops the image to mrowsXncols before transformation
ncols --pads or crops the image to mrowsXncols before transformation
DESCRIPTION
dct2 performs 2D-DCT on an input image. It reads the image from the input file, pads or crops the image if necessary,
and performs the 2D-DCT transformation. The output of the 2D-DCT transformation is a real matrix, which is returned
to the user. The transformed image is also displayed on the screen.
This implementation of dct2 makes use of the "dct" function provided by MATLAB. "dct" is first applied to the rows of
the image; after that, "dct" is again applied to the columns of the row-transformed image.
EXAMPLES
lena_dct2=dct2('LENA.TIF')
This example performs 2D-DCT of LENA and stores the transform of the image in the variable "lena_dct2" (Figure
6.1a).
ptr_dct2=dct2('PAINTER.TIF')
This example performs 2D-DCT of PAINTER and stores the transform of the image in the variable "ptr_dct2" (Figure
6.1b).
a. 2D-DCT of LENA b. 2D-DCT of PAINTER
Figure 6.1 Examples of 2D-DCT transformed images
NAME
idct2 - performs inverse 2D-DCT on an input array.
SYNOPSIS
idct2(x, output_file_name)
idct2(x, output_file_name, [mrows, ncols])
idct2(x, output_file_name, mrows, ncols)
x -- the matrix representation of a DCT transformed image
mrows -- pads or crops the image to mrowsXncols before transforming
ncols -- pads or crops the image to mrowsXncols before transforming
DESCRIPTION
idct2 performs 2D-IDCT on a DCT transformed input image. x, which is a real matrix, is the DCT-transformed image.
idct2 reads an image matrix, crops the image if necessary before transformation, and performs the inverse
transformation. The output of the idct2 function is written to the output file. The format of the output image is TIFF.
This implementation of idct2 makes use of the "idct" function provided by MATLAB. idct is first applied to the rows of
the image; after that, idct is again applied to the columns of the row-transformed image
EXAMPLES
idct2(lena_dct2, 'id_lena.tif')
This example performs 2D-IDCT of the previously 2D-DCT transformed LENA (Figure 6.2a).
idct2(ptr_dct2, 'id_ptr.tif')
This example performs 2D-IDCT of the previously 2D-DCT transformed PAINTER (Figure 6.2b).
a. Restored LENA via 2D-IDCT b. Restored PAINTER via 2D-IDCT
Figure 6.2 Examples of 2D-IDCT transformed images

More Related Content

Similar to Discrete Cosine Transforms.pdf

Gh2411361141
Gh2411361141Gh2411361141
Gh2411361141
IJERA Editor
ย 
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
ย 
Can someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdfCan someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdf
kuldeepkumarapgsi
ย 
Designed by Identity MLP
Designed by Identity MLP Designed by Identity MLP
Designed by Identity MLP
butest
ย 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
IJERD Editor
ย 
Jv2517361741
Jv2517361741Jv2517361741
Jv2517361741
IJERA Editor
ย 
Fast dct algorithm using winogradโ€™s method
Fast dct algorithm using winogradโ€™s methodFast dct algorithm using winogradโ€™s method
Fast dct algorithm using winogradโ€™s method
IAEME Publication
ย 

Similar to Discrete Cosine Transforms.pdf (20)

Memory Optimization in Cocos2d-x WP8 using Compressed Textures
Memory Optimization in Cocos2d-x WP8 using Compressed TexturesMemory Optimization in Cocos2d-x WP8 using Compressed Textures
Memory Optimization in Cocos2d-x WP8 using Compressed Textures
ย 
Gh2411361141
Gh2411361141Gh2411361141
Gh2411361141
ย 
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...
ย 
An35225228
An35225228An35225228
An35225228
ย 
I3602061067
I3602061067I3602061067
I3602061067
ย 
Can someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdfCan someone please explain what the code below is doing and comment on.pdf
Can someone please explain what the code below is doing and comment on.pdf
ย 
Designed by Identity MLP
Designed by Identity MLP Designed by Identity MLP
Designed by Identity MLP
ย 
H0545156
H0545156H0545156
H0545156
ย 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
ย 
Jv2517361741
Jv2517361741Jv2517361741
Jv2517361741
ย 
Jv2517361741
Jv2517361741Jv2517361741
Jv2517361741
ย 
2 transformation computer graphics
2 transformation computer graphics2 transformation computer graphics
2 transformation computer graphics
ย 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
ย 
Matlab Implementation of Baseline JPEG Image Compression Using Hardware Optim...
Matlab Implementation of Baseline JPEG Image Compression Using Hardware Optim...Matlab Implementation of Baseline JPEG Image Compression Using Hardware Optim...
Matlab Implementation of Baseline JPEG Image Compression Using Hardware Optim...
ย 
Fast dct algorithm using winogradโ€™s method
Fast dct algorithm using winogradโ€™s methodFast dct algorithm using winogradโ€™s method
Fast dct algorithm using winogradโ€™s method
ย 
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...
ย 
A COMPARATIVE STUDY OF IMAGE COMPRESSION ALGORITHMS
A COMPARATIVE STUDY OF IMAGE COMPRESSION ALGORITHMSA COMPARATIVE STUDY OF IMAGE COMPRESSION ALGORITHMS
A COMPARATIVE STUDY OF IMAGE COMPRESSION ALGORITHMS
ย 
2022-01-17-Rethinking_Bisenet.pptx
2022-01-17-Rethinking_Bisenet.pptx2022-01-17-Rethinking_Bisenet.pptx
2022-01-17-Rethinking_Bisenet.pptx
ย 
Efficient Implementation of Low Power 2-D DCT Architecture
Efficient Implementation of Low Power 2-D DCT ArchitectureEfficient Implementation of Low Power 2-D DCT Architecture
Efficient Implementation of Low Power 2-D DCT Architecture
ย 
IRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD TechniquesIRJET- Digital Watermarking using Integration of DWT & SVD Techniques
IRJET- Digital Watermarking using Integration of DWT & SVD Techniques
ย 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
SUHANI PANDEY
ย 

Recently uploaded (20)

(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
ย 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
ย 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
ย 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth โŸŸ 6297143586 โŸŸ Call Me For Genuine Se...
ย 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
ย 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
ย 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
ย 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
ย 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
ย 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
ย 

Discrete Cosine Transforms.pdf

  • 1. Discrete Cosine Transforms The discrete cosine transform (DCT) is another frequently used transform in image processing. An advantage of DCT over DFT is that DCT does not involve complex computations. The equations for DCT and inverse DCT are shown below: NAME dct2 - performs 2D-DCT of an input image and returns the transformed image to the user. SYNOPSIS dct2(input_file_name) dct2(input_file_name, [mrows, ncols]) dct2(input_file_name, mrows, ncols) mrows --pads or crops the image to mrowsXncols before transformation ncols --pads or crops the image to mrowsXncols before transformation DESCRIPTION dct2 performs 2D-DCT on an input image. It reads the image from the input file, pads or crops the image if necessary, and performs the 2D-DCT transformation. The output of the 2D-DCT transformation is a real matrix, which is returned to the user. The transformed image is also displayed on the screen. This implementation of dct2 makes use of the "dct" function provided by MATLAB. "dct" is first applied to the rows of the image; after that, "dct" is again applied to the columns of the row-transformed image. EXAMPLES lena_dct2=dct2('LENA.TIF') This example performs 2D-DCT of LENA and stores the transform of the image in the variable "lena_dct2" (Figure 6.1a). ptr_dct2=dct2('PAINTER.TIF') This example performs 2D-DCT of PAINTER and stores the transform of the image in the variable "ptr_dct2" (Figure 6.1b). a. 2D-DCT of LENA b. 2D-DCT of PAINTER
  • 2. Figure 6.1 Examples of 2D-DCT transformed images NAME idct2 - performs inverse 2D-DCT on an input array. SYNOPSIS idct2(x, output_file_name) idct2(x, output_file_name, [mrows, ncols]) idct2(x, output_file_name, mrows, ncols) x -- the matrix representation of a DCT transformed image mrows -- pads or crops the image to mrowsXncols before transforming ncols -- pads or crops the image to mrowsXncols before transforming DESCRIPTION idct2 performs 2D-IDCT on a DCT transformed input image. x, which is a real matrix, is the DCT-transformed image. idct2 reads an image matrix, crops the image if necessary before transformation, and performs the inverse transformation. The output of the idct2 function is written to the output file. The format of the output image is TIFF. This implementation of idct2 makes use of the "idct" function provided by MATLAB. idct is first applied to the rows of the image; after that, idct is again applied to the columns of the row-transformed image EXAMPLES idct2(lena_dct2, 'id_lena.tif') This example performs 2D-IDCT of the previously 2D-DCT transformed LENA (Figure 6.2a). idct2(ptr_dct2, 'id_ptr.tif') This example performs 2D-IDCT of the previously 2D-DCT transformed PAINTER (Figure 6.2b). a. Restored LENA via 2D-IDCT b. Restored PAINTER via 2D-IDCT Figure 6.2 Examples of 2D-IDCT transformed images