0% found this document useful (0 votes)
2 views

Lecture-4

This lecture discusses geometric primitives, which are fundamental shapes used in computer graphics and vision, including points, lines, and polygons. It also covers how images are represented as functions, the quantization of digital images, and the calculation of image size and pixel depth. Key concepts include the use of RGB color channels and the mathematical representation of 2D lines and images.

Uploaded by

Thet Hsu
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture-4

This lecture discusses geometric primitives, which are fundamental shapes used in computer graphics and vision, including points, lines, and polygons. It also covers how images are represented as functions, the quantization of digital images, and the calculation of image size and pixel depth. Key concepts include the use of RGB color channels and the mathematical representation of 2D lines and images.

Uploaded by

Thet Hsu
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Computer Vision

Geometric Primitives and Image Representation


Lecture – 4

Presented By
Dr. Yin Win Chit
Associate Professor
Geometric primitives

 Geometric primitives are the basic building blocks used in computer graphics, computer
vision, and computational geometry.

 These simple shapes and objects form the foundation for modeling more complex
structures and scenes.

 Geometric primitives are often defined by mathematical formulas or parameters that


describe their structure, size, and position.
Geometric primitives
• Used in various senses, with the common meaning of the simplest (i.e. 'atomic' or
irreducible) geometric objects that the system can handle (draw, store).

• A common set of two-dimensional primitives includes lines, points, and polygons.

• Some people prefer to consider triangles primitives, because every polygon can be
constructed from triangles.

• All other graphic elements are built up from these primitives.


2D points
• 2D points (pixel coordinates in an image) can be denoted using a pair of values,

R refers to the set of all Real numbers


means pairs of real numbers (x,y)

Example:
If X = (3.5, -2) , x=3.5 , y=-2 , Therefore (3.5, -2) € R
2D lines

• 2D lines can be represented using homogeneous coordinates


Line equation
ax + by + c = 0
This equation is a standard way to represent a straight line in 2D space
2D lines – Cont’d
ax + by + c = 0
2D lines – Cont’d
ax + by + c = 0
2D lines – Cont’d
ax + by + c = 0
Image as Functions
Table: Intensity values of Images

An image as a function, f or I from R2 to R: Color R G B


Black 0 0 0
f(x, y) gives the intensity or value at (x, y)
White 255 255 255
f(x,y) = intensity at point (x, y) Red 255 0 0
Green 0 255 0
(two dimensional space to the intensity value R)
Blue 0 0 255
Input : coordinate of image

Output: intensity value at the coordinate (x,y)

f(x,y) € [0,255] for 8 bits images


Image as Functions
Table: Intensity values of Images
Color R G B
Black 0 0 0
White 255 255 255
Red 255 0 0
Green 0 255 0
Blue 0 0 255
Image as Functions
Practically define the image over a rectangle, with a finite range:

f : [a, b] x [c, d] y [min, max]


Image as Functions
Image as Functions

Final Image Matrix


Define an image as a function

R
X
R 5

𝟏𝟎
R 𝒇 : 𝑹× 𝑹⇒ 𝑹

5
𝟎
Y 10 5

[ 10, 95 ] [ 15, 115 ] [ 0, 10 ]


Define a color image as a function

(R, G, B)
( 𝒂) 𝒇 : 𝑹 × 𝑹 × 𝑹 ⇒ 𝑹
3

( 𝒄 ) 𝒇 : 𝑹× 𝑹× 𝑹⇒ 𝑹× 𝑹× 𝑹
( 𝒅 ) 𝒇 : 𝑹× 𝑹⇒ 𝑹× 𝑹× 𝑹
channels or planes Ans: b and d
Compute image size

X
30

Y height 215
3 colors
245
45150
10 220
width 210 area 45150
Digital Images
• In computer vision we typically operate on digital (discrete) images:
• Sample the 2D space on regular grid
• Quantize each sample (round to nearest integer)
• Image thus represented as a matrix of integer values.
Quantize an image
Quantize an image
Quantize an image

2.6 -1.2 4 8 2 0 4 5

1.7 3.5 8.1 -2.6 1 3 5 0

7.2 2.8 -3.3 4.1 5 2 0 4

Round down : 1.7 to 1 Levels : 0, 1, 2, 3, 4, 5


Limits: < 0 to 0
> 5 to 5
Quiz

What is the equation used to obtain I(Intensity) component of each RGB pixel in RGB
color format?
a) I=1/2(R+G+B)
b) I=1/3(R+G+B)
c) I=1/3(R-G-B)
d) I=1/3(R-G+B)

Ans: b
Quiz

What do you mean by the term pixel depth?


a) It is the number of bits used to represent each pixel in RGB space
b) It is the number of bytes used to represent each pixel in RGB space
c) It is the number of units used to represent each pixel in RGB space
d) It is the number of mm used to represent each pixel in RGB space

Ans: a
Let's summarize:
• Which are basic geometric primitives
• Color channels and image size calculation
• How computer see the images
Lecture End!

You might also like