0% found this document useful (0 votes)
17 views31 pages

Group 10 Presentation

Uploaded by

mebrat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views31 pages

Group 10 Presentation

Uploaded by

mebrat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

MU-MIT

Image processing
Course project presentation

Discrete cosine Transform and Hough


Transform
by
Bruk G/yohans &
G/yowhans Hailekiros

Submitted to: MR. Micheale Hadera


Discrete cosine Transform
 The discrete cosine transform (DCT) represents an image
as a sum of sinusoids of varying magnitudes and
frequencies.

 The DCT transforms a signal from a spatial


representation into a frequency representation.
 In an image, most of the energy will be concentrated in
the lower frequencies, so if we transform an image into
its frequency components and throw away the higher
frequency coefficients, we can reduce the amount of data
needed to describe the image without sacrificing too
much image quality.
 For this reason, the DCT is often used in image
The Discrete Cosine Transform (DCT)

• the human eye is most sensitive to low


frequencies.
• the image is divided into parts (according to
frequencies)
• important lower frequencies are kept
• higher ones are discarded
• It is a lossy algorithm
Why DCT ?

• digital images require much storage space

• compressed data takes up less storage


space
The Discrete Cosine Transform (DCT)
The JPEG Compression process
 One application of DCT is in image compression
 The following is the general overview of Jpeg
compression process:
1. Image is broken into 8x8 blocks of pixels
2. Working from left to right, top to bottom DCT is
applied to each block
3. Each block is compressed through quantization
4. The image will be reconstructed by applying invers
DCT through Decompression
• The 2D-Discrete Cosine Transform (DCT), which
has the following equation:

• N represents the size of divided blocks


• x and y are the number of rows and columns.
• It is common to divide the image into 8 by 8
blocks. This generates the following equation
with N= 8:
The Transformation matrix
• To get the Transformation matrix T from the above
equation we will use the following equation:

• For an 8X8 block the Transformation matrix should


be as in the following slide .
• This results in the following matrix T:

• We use the matrix T to perform the DCT on our desired image blocks. This is
done through multiplication with the original block matrix M in the following
manner:

• The original block M is multiplied first with the DCT matrix T to transform
the rows and then with the transpose of the DCT matrix to transform the
columns.
• In grayscale, images range between values 0 and
255, where 0 is pure black and 255 is pure white.
• However DCT is designed to work on ranges
between -128 and 128.
• Thus we subtract 128.
• This is when we show the original image using the
command “imshow”.
Quantization
 Varying levels of image compression and quality are obtainable
through selection of specific quantization matrices.
 This enables user to decide on quality levels ranging from 1 to 100.
 Subjective experiments yielded the following matrix Q with quality
level 50 as a standard quantization matrix.
 The quantization table represents the phase when we discard
the frequencies.
• Quantization is then performed by dividing
each element of the transformed image matrix
D by its corresponding element in the
quantization matrix Q that we explained
previously.
• This is then rounded to get positive integer
values.
As a result we have the lower frequencies in the upper-left corner, while
the higher frequencies are represented with zeros, which can be discarded.

because the human eye is most sensitive to lower frequencies, and


won’t detect the averaging of the higher ones with more rapid
variations. Remember that the goal of data compression is to represent
the data in a way that reveals some redundancy.
As we discard part of the original data of the
image, this type of compression is considered a
lossy compression.
Only the non-zero coeefficients are used to
reconstruct the image.
• As a last step the compressed file is decompressed again
to retrieve the original image.
• The reconstruction of the image is done by reversing all
previous steps of compression:
 We divide the image again into 8×8 blocks and
multiplying this time by the quantization matrix Q.
 IDCT is then applied to the resulting matrix to
reverse the discrete cosine transform performed
before and rounded again.
 The blocks are gathered into one matrix again and
128 are added to construct the decompressed format
of the image.
By comparing the original file to the compressed
version:

Original file compressed file (


size: 122 kb size: 112 kb
By comparing the original file to the compressed
version:

Original file compressed file (


size: 63 kb size: 11 kb
HOUGH TRANSFORM

VISHWAKARMA INSTITUTE OF TECHNOLOGY,PUNE 18


Introduction:
• It is invented by Paul Hough.
• The Hough transform was patented in 1962
with name ‘method and means for detecting
complex patterns ’ the patent uses slope
intercept model for straight lines.
• It is redefined by R. O. Duda and P.E. Hart in
1972 and known as ‘GENERALIZED HOUGH
TRANSFORM’.

19
Basics of Hough transform
• Hough space: Hough space is same as Cartesian
co-ordanate system except,
• it’s x-axis represent angles in accumulator.
• It’s y-axis represent distance of line from agreed
origin.
ρ =100

ρ =0

Ө=0 Ө=180 20
Linear Hough Transform
• The linear Hough transform is popularly used for
detecting lines.
o/p
Image Edge Accumulator
LHT
detection

• The dimension of accumulator equals to number of


unknown parameters i.e. 2
• One dimension of this matrix is quantized angle ө
and other is distance ρ.
• Each element of matrix has a value equal to
number of points that are positioned on line
represented by quantized parameters. 21
Algorithm
• For each data point, a number of lines are plotted
going through it, all at different angles.
• For each solid line a line is plotted which s
perpendicular to it and which intersects the origin
these.
• The length and angle of each perpendicular is
measured and saved in accumulator.
• This is repeated for each point.
• A graph of the line lengths for each angle, known as
a Hough space graph, is then created.
22
Let see how it works?

Angle Distance
0 40
30 69.6
60 81.2
90 70
120 40.6

23
Continued….

24
Accumulator plotted in Hough space

25
EXAMPLE:

Input edge

26
Example:
• accumulator result

27
Advantages & Disadvantages
• Advantages:
1)Conceptually simple technique.
2)Handles missing occluded data gracefully.
3) Can be adapted for many other forms.

• Disadvantages:
1)Large storage space required.
2)Checks for only one type of object.
28
Conclusion
Although it is the commonly preferred method
for lines & circle detection, the HT in general
has several limitations making it challenging to
detect anything other than lines and circles.
This is especially the case when more
parameters are needed to describe shapes,
this add more complexity.

29
THANK YOU

VISHWAKARMA INSTITUTE OF TECHNOLOGY,PUNE 30


Questions

VISHWAKARMA INSTITUTE OF TECHNOLOGY,PUNE 31

You might also like