lFinalGroup-8
lFinalGroup-8
lFinalGroup-8
Presented to : Presented by :
Mahbubun Nahar Rayhan Mahmud Kabir Sanzid
Assistant Professor Somya Akter Smrity
Shariful Islam
Md. Ashikur Rahman Ashik
Sumon Parvez
Malobika Yesmin Tithi
2
Image
Compression
Introduction to Image Compression
Image compression is the art and science of reducing the amount of data required to
represent an image.
Everyone who owns a digital camera, surfs the web, or streams movies over the Internet
benefits from image compression algorithms and standards.
3
Image
Fundamentals of Data Compression Compressio
n
Key Concepts
Data vs Information:
• Data are the means to convey information.
• Different amounts of data can represent the same information.
Compression Ratio:
• Compression ratio (C) is defined as the ratio of the original size to the compressed size.
4
Image
Types of Data Redundancies Compressi
on
Principal Types
Coding Redundancy:
• Occurs when using more bits than necessary to represent information.
Irrelevant Information:
• Information that is ignored by the human visual system or extraneous to the intended use of the image.
5
Image
Compressio
n
Coding Redundancy
Coding redundancy is addressed by assigning shorter code words to
frequently occurring intensity values.
6
Image
Compressi
on
Spatial and Temporal Redundancy
7
Image
Compression
Irrelevant Information
Irrelevant information refers to data omitted without loss of perceived
image quality.
8
Image
Compressio
n
Image Information Measurement
Entropy:
• The average information per source output.
• Measured in bits/pixel using the formula Ĥ = -Σp(k)log₂P(k).
9
Image
Compression
Image Compression Models
10
Image
Compression
Image Formats and Compression Standards
• Image formats define how image data is arranged and the type of
compression used.
• Examples include JPEG, PNG for still images, and MPEG, H.264 for video.
11
Image
Compression
Digital Image Watermarking
12
Video
Compressio
n
Video Compression
I. Spatial redundancy
II. Temporal redundancy
13
Video
Compressi
on
Types of Video Compression
14
Video
Compression
Necessity of Video Compression
15
Video
Compressi
on
Video Compression Techniques
16
Video
Compressi
on
Video Compression Formats
Some of the most popular formats for compressing video include:
• H.264 (MPEG-4 AVC): Short for Advanced Video Coding, it's the most
common compression format today & it offers high-quality video at low file
sizes.
• H.265 (HEVC): Short for High Efficiency Video Coding, it's the successor
to H.264. It often produces better quality video at smaller file sizes than
H.264.
• VP8: Open-sourced by Google, it's mainly used for short looping video
formats, as an alternative to GIFs.
17
Video
Compressio
n
Video Compression Formats
18
Video
Compressi
on
Application of Video Compression
Cable TV distribution
Interactive communications
Digital storage media
Video-on-demand
Broadcasting
19
Video
Compression
Advantages of Video Compression
20
Video
Compression
Disadvantages of Video Compression
21
Video
Compression
Huffman Coding
Huffman coding is a lossless data compression technique widely used in image processing to
reduce the size of images while retaining all original information. It is especially effective in
scenarios where data has a skewed probability distribution, like grayscale images or image
histograms.
22
Video
Compression
Example of Huffman Coding
23
Video
Compression
Golomb Coding
Golomb coding is a lossless data compression technique commonly used for encoding
sequences of integers. It is particularly efficient for data with a geometric distribution (i.e.,
when smaller values are more frequent). It works by dividing integers into two parts using a
divisor (also called a parameter, typically denoted as mmm) and then encoding each part
separately.
24
Video
Compression
Arithmetic Coding
Arithmetic coding is a lossless compression technique used to efficiently encode data by
representing entire messages as a single fractional number between 0 and 1. It is
particularly effective for image compression because it can achieve high compression
ratios by exploiting the statistical properties of image data.
Final Output:
Encode the interval [0.56, 0.568) as a single number, e.g., 0.565.
Decoding:
Reverse the process by mapping the number back through the probability intervals.
26
Video
Compression
LWZ Coding
LZW (Lempel-Ziv-Welch) coding is a lossless data compression algorithm widely used in
image file formats like GIF and TIFF. It is based on dictionary-based encoding, where
sequences of data are replaced with shorter codes that represent entire strings of symbols.
28
Video
Compression
One Dimensional CCIT Compression
The CCITT (Consultative Committee for International Telephony and Telegraphy) 1D
compression method, also known as Modified Huffman Coding, is a lossless compression
technique commonly used for black-and-white images in fax transmission. It encodes binary
images (1-bit per pixel) by exploiting the frequent runs of black or white pixels.
Example of CCIT:
29
Video
Compression
Lossless Predictive Coding
Lossless predictive coding is a compression technique where the value of each pixel (or data point)
is predicted based on the values of neighboring pixels. The difference between the actual value
and the predicted value, called the residual (or error), is stored instead of the original value. Since
the residuals are often smaller and less variable, they can be compressed more efficiently.
Example:
30
Boundary
Extraction
Boundary Extraction
Definition:
A background region
Surrounded by a connected border of foreground pixels.
Objective:
Replace all background pixels (holes) with foreground pixels
Ensuring the enclosed regions are completely filled.
For example:
Let A denote a set whose elements are 8-connected boundaries
With each boundary enclosing a background region (i.e., a hole).
Given a point in each hole, the objective is to fill all the holes with foreground elements (1’s).
33
Hole
Filling
Hole Filling
35
Hole
Filling
Hole Filling
Reference: https://www.cis.rit.edu/class/simg782/lectures/lecture_04/lec782_05_04.pdf
38
Convex
Hull
Convex Hull
39
Convex
Hull
Convex Hull
40
Thinning
Thinning: Definition
Thinning is a morphological operation that removes pixels from the boundaries of objects in a
binary image
Thinning is a morphological operation applied to a set A of foreground pixels using a
structuring element B.
It is defined using the hit-or-miss transform:
A ⊗ B = A − (A ⊛ B) = A ∩ (A ⊛ B)^c
41
Thinning
Thinning
Fig : (a) Structuring elements. (b) Set A. (c) Result of thinning A with B1 (shaded). (d) Result of thinning A1 with B2.
(e)–(i) Results of thinning with the next six SEs. (There was no change between A7 and A8.) (j)–(k) Result of using
the first four elements again. (l) Result after convergence. (m) Result converted to m-connectivity.
42
Thinning
Thinning : Application
Character recognition (e.g., handwriting analysis).
Medical imaging (e.g., blood vessel detection).
Image analysis and pattern recognition.
43
Thickening
Thickening: Definition
Thickening is the opposite of thinning. It adds pixels to the boundaries of
objects in a binary image.
Thickening is the morphological dual of thinning and is defined as:
A ⊙ B = A ∪ (A ⊛B)
44
Thickening
Thickening
Fig : (a) Set A. (b) Complement of A. (c) Result of thinning the complement. (d) Thickened
set obtained by complementing (c). (e) Final result, with no disconnected points.
45
Thickening
Thickening : Application
Restoring objects after thinning in skeletonization.
Improving feature extraction where thicker objects are needed for
analysis.
Enhancing details in medical imaging or character recognition
systems
46
Skeleton
Skeleton: Definition
Maximum Disk: A maximum disk is a disk centered at a point z in S(A) that is fully contained within A. It
is the largest such disk at that point.
Skeleton Properties:
1.A point z belongs to S(A) if the maximum disk centered at z cannot be enlarged while still remaining
within A.
2 .A maximum disk touches the boundary of A at two or more points.
47
Skeleton
Skeleton
Skeleton Calculation:
The skeleton can be calculated using a series of erosions and openings.
Fig: (a) Set A. (b) Various positions of maximum disks whose centers partially define the skeleton of A.
(c) Another maximum disk, whose center defines a different segment of the skeleton of A. (d) Complete
skeleton (dashed).
48
Skeleton
Skeleton : Application
Character recognition (e.g., Optical Character Recognition or OCR).
Medical imaging (e.g., for analyzing structures like blood vessels, bones, etc.).
Shape analysis in machine vision or industrial inspection.
49
Pruning
Pruning: Definition
It refines binary images by removing unnecessary branches, often cleaning up skeletal structures.
How it Works: It identifies and removes small, irrelevant branches from the skeletonized
image.
50
Pruning
Pruning: Application
Optical Character Recognition (OCR).
Medical image analysis (e.g., blood vessel detection).
Feature extraction in machine vision
51
Dilation
Dilation
52
Dilation
Example: Using dilation to repair broken characters in an image.
53
Erosion
Erosion
54
Erosion
Example:Using erosion to remove image components.
55
Opening
Opening
Opening generally smoothes contour of the distorted image and fuse back
the narrow breaks and long thin gulfs.
The opening of set A by structuring element B, denoted by is
defined as
where,
U denotes the union of the sets inside the braces
56
Opening
Example
57
Closing
Closing
58
Closing
Example
59
Ref..
References
1. Gonzalez, Rafael. Digital Image Processing. 4th Edition.
2. "Digital Image Processing, 3rd Edition" [PDF]. Available at:
https://dl.ebooksworld.ir/motoman/Digital.Image.Processing.3rd.Edition.www.EBooksWorld.ir.pdf.
3. GeeksforGeeks. "Python Morphological Operations in Image Processing | Closing (Set-2)." Available at:
https://www.geeksforgeeks.org/python-morphological-operations-in-image-processing-closing-set-2/.
4. Scaler Topics. "Erosion and Dilation in Image Processing." Available at:
https://www.scaler.com/topics/erosion-and-dilation-in-image-processing/.
5. GetStream.io. "Video Compression Glossary." Available at: https://getstream.io/glossary/video-compression/.
6. ImageKit.io. "Video Compression Techniques." Available at: https://imagekit.io/blog/video-compression-techniques/.
7. K.D.K. College of Engineering. "Compression." Available at:
https://www.kdkce.edu.in/pdf/RAB-8ETRX-DCE-U3-COMPRESSION.pdf.
8. CIS Rochester Institute of Technology. "Lecture 4: Image Processing" [PDF]. Available at:
https://www.cis.rit.edu/class/simg782/lectures/lecture_04/lec782_05_04.pdf.
9. GeeksforGeeks. "Different Morphological Operations in Image Processing." Available at:
https://www.geeksforgeeks.org/different-morphological-operations-in-image-processing/.
10. GeeksforGeeks. "How to Find Interior and Exterior Skeleton of Binary Images Using MATLAB." Available at:
https://www.geeksforgeeks.org/how-to-find-interior-and-exterior-skelton-of-binary-images-using-matlab/.
11. The AI Learner. "Thinning and Thickening." Available at:
https://theailearner.com/2019/07/31/thinning-and-thickening/.
60
ACK.
Acknowledgements
We are grateful to
Mahbubun Nahar ma’am (Course Teacher)
Our classmates
Our teachers of CSE, JKKNIU
Department of CSE, JKKNIU
61
End
The End
62