+ All Categories
Home > Documents > 2 Introduction to Computer Vision Course

2 Introduction to Computer Vision Course

Date post: 11-Dec-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
27
Lecture 2 Point Operations
Transcript

Lecture 2

Point Operations

Last lecture covered

� Images and pictures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . � What is image processing? . . . . . . . . . . . . . . . . . . . . . . . .� Image Acquisition and sampling . . . . . . . . . . . . . . . . . . . � Images and digital images . . . . . . . . . . . . . . . . . . . . . . . .� Some applications . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . � Aspects of image processing . . . . . . . . . .. . . . . . . . . . . . . � An image processing task . . . . . . . . . . . . . . . . . . . . . . . . .� Types of digital images . . . . . . . . . . . . . . . . . . . . . . . . . . . � Image File Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . � Spatial Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . � Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Content

� Point Processing

2.1 Introduction . . . . . . . . . . . . . . . . . . . .

2.2 Arithmetic operations . . . . . . . . . . . .

2.3 Histograms . . . . . . . . . . . . . . . . . . . .

2.4 Lookup tables . . . . . . . . . . . . . . . . . .

� Exercises

Pixel neighbors

Neighborhood processing vs. Point

operations

�� Neighborhood processing. Neighborhood processing.

� To change the grey level of a given pixel we

need only know the value of the grey levels

in a small neighborhood of pixels around the

given pixel.

�� Point operations. Point operations.

� A pixel's grey value is changed without any

knowledge of its surrounds.

What is the aim of “Point Operations”?

� Although point operations are the simplest, they contain some of the most powerful and widely used of all image processing operations.

� They are especially useful in image pre-processing, where an image is required to be modified before the main job is attempted.

2.2 Arithmetic operations

� These operations act by applying a simple function

y = f(x)

� Types of operations:

1. Addition/Subtraction

2. Multiplications/Division

3. Complementary

1. Addition/Subtraction

� To add /subtract a constant from each pixel in the image.

y = x ± C

0…………………..….255

Old image (x)

ne

w im

ag

e f

(x)

0…

……

……

……

….2

55

0…………………..….255

Old image (x)

ne

w im

ag

e f

(x)

0…

……

……

……

….2

55

C

y = f(x)

1. Addition/Subtraction

� Original (x) y = x + 128 y = x -128

� To multiply /divide each pixel in the

image x in/by a constant c.

y = x × C , y = x ÷ C

2. Multiplications/Division

0…………………..….255

Old image (x)

ne

w im

ag

e f

(x)

0…

……

……

……

….2

55

0…………………..….255

Old image (x)

ne

w im

ag

e f

(x)

0…

……

……

……

….2

55

y = f(x)

2. Multiplications/Division

3. Complements

� The complement of a greyscale image is its photographic negative.

What is image Solarization?

� Complementing only part of the image.

Color Images Operations

Size:

m×n×3 m×n m×n m×n

Matrix:

x x( : , : ,1) x( : , : ,2) x( : , : ,3)

Color Images Operations

� Possible channel operations:

� Changing the image lighting color.

� Swapping image channels.

� Eliminating color channels.

Changing the image lighting color

� To change the intensity of one or more channel by adding or subtracting a constant.

� R + C => the image will be reddish

� G + C => the image will be greenish

� B + C => the image will be bluish

� R,G + C => the image will be yellowish

� ….

RGB Cube

Changing the image lighting color

Swapping image channels

� To exchange the intensity between the image channels.

� R , G => the image will be GRB

� G , B => the image will be RBG

� B , R => the image will be BGR

� Other spaces could be obtained by swapping 2 channels at once like; GBR and BRG

Swapping image channels

R, G G,B R,B

Eliminating color channels

� To set one or more color channels by zero values.

� Eliminating R => image will be in cyan

� Eliminating G => image will be in magenta

� Eliminating B => image will be in yellow

� Eliminating R,G => image will be in blue

� Eliminating G,B => image will be in red

� Eliminating B,R => image will be in green

Eliminating color channels

R=0 G=0 B=0

G,B=0 R,B=0 R,G=0

Multiple Image Operations

� One can perform operations between two images or more for:

� Enhance the image visual appeal.

� Getting specific part of image between

similar images.(eg. motion tracking)

� For some preprocessing purposes.

Multiple Image Operations

� Assume two images x1 and x2: the possible operations between x1 and x2:

• y = x1 + x2

• y = x1 – x2• y = x1 × x2

• y = x1 ÷ x2

• y = diff(x1, x2)• y = max(x1,x2)• y = min(x1,x2)• y = avg(x1,x2)

• y = x1 AND x2• y = x1 OR x2• y = x1 XOR x2

Example

Addition

AND

Subtraction

OR

Exercise

1. Find the relation between the multiplication factor CC and the rotation

angle өө.

2. What do you expect if we perform the following function:

1. Y = x - R


Recommended