You are on page 1of 33

University of Baghdad

Al-Khwarizmi College of Engineering


Biomedical Engineering Department

Image processing for BME 2


5th Stage

Lecture 2
Image Enhancement using Operations

By:
Dr. Noor Kamal
PhD in Biomedical Engineering
Image processing for BME 2_Lec 2_ 2020 1
Basic Arithmetic Operations
Operation Definition
ADD c=a+b
SUB c=a-b
MUL c=a*b
DIV c=a/b
LOG c = log(a)
EXP c = exp(a)
SQRT c = sqrt(a)
TRIG. c = sin/cos/tan(a)

Image processing for BME 2_Lec 2_ 2020 2


Arithmetic Operations
The four arithmetic operations are denoted as:

Image processing for BME 2_Lec 2_ 2020 3


Further Image Operations

• Unary operations (Process->Math->...)


• O(x, y) = log(I(x, y))
• O(x, y) = 1/I(x, y)
• Binary operations with constant (Process->Math->...)
• O(x, y) = I(x, y) + a
• O(x, y) = I(x, y)*b
• Binary operations with images (Process->Image Calculator)
• O(x, y) = I1(x, y) + I2(x, y)
• O(x, y) = I1(x, y) – I2(x, y)

Image processing for BME 2_Lec 2_ 2020 4


Arithmetic operations - Addition

Image processing for BME 2_Lec 2_ 2020 5


Image processing for BME 2_Lec 2_ 2020 6
Image Subtraction

Image processing for BME 2_Lec 2_ 2020 7


Image processing for BME 2_Lec 2_ 2020 8
Image Subtraction

Slice 22 Slice 23 22 - 23

Image processing for BME 2_Lec 2_ 2020 9


Image Subtraction

Image processing for BME 2_Lec 2_ 2020 10


11
Image processing for BME 2_Lec 2_ 2020
Image Division

Image processing for BME 2_Lec 2_ 2020 12


Image Averaging for noise reduction

K
1
g ( x, y ) 
K
 g ( x, y )
i 1
i

Image processing for BME 2_Lec 2_ 2020 13


Image Averaging for noise reduction

E{g ( x, y )}  f ( x, y )

1 2
 2
g ( x, y )    ( x, y )
K

Image processing for BME 2_Lec 2_ 2020 14


Image Averaging

K=5 K=10

K=20 K=50 K=100

(a) Image of Galaxy Pair NGC 3314 corrupted by additive Gaussian noise. (b)–(f)
Results of averaging 5, 10, 20, 50, and 100 noisy images, respectively.

Image processing for BME 2_Lec 2_ 2020 15


© 2002 R. C. Gonzalez & R. E. Woods
Basic set operations

Image processing for BME 2_Lec 2_ 2020 16


Basic set operations

Image processing for BME 2_Lec 2_ 2020 17


Basic set operations

Image processing for BME 2_Lec 2_ 2020 18


Basic set operations

Image processing for BME 2_Lec 2_ 2020 19


Basic set operations

Image processing for BME 2_Lec 2_ 2020 20


Basic set operations

Image processing for BME 2_Lec 2_ 2020 21


Basic Logic Operations

Operation Definition
NOT
OR
AND
XOR

Image processing for BME 2_Lec 2_ 2020 22


Basic Logic Operations

Image processing for BME 2_Lec 2_ 2020 23


Basic Logic Operations
Illustration of logical operations
involving foreground (white) pixels.
Black represents binary 0 s
and white binary 1s.
The dashed lines are shown
for reference only.
They are not part of the result.

Image processing for BME 2_Lec 2_ 2020 24


Basic Logic Operations

And =

OR =

Image processing for BME 2_Lec 2_ 2020 25


Image Scaling, Rotation, Translation

Image processing for BME 2_Lec 2_ 2020 26


Image Rotation

Image processing for BME 2_Lec 2_ 2020 27


Image Rotation

Image processing for BME 2_Lec 2_ 2020 28


Stacks
• Stacks are sequences of images, all have the same
dimensions
• Most often, a stack is a sequence of slices through a
3-D object

Image processing for BME 2_Lec 2_ 2020 29


Resizing Images

Image processing for BME 2_Lec 2_ 2020 30


Zooming : Shrinkage:
• Creating new pixel locations • Deleting some of the rows and columns
• Assigning gray-level values to these of the image.
locations • Shrinkage by a non-integer factor can be
Solution: Interpolation done as the inverse of zooming.

Zooming Pixel replication: interpolated pixel in the enlarged image is set to the
gray-level of its nearest pixel in the original image.
• Bilinear interpolation: interpolated pixel in the enlarged image is set to the average
its four nearest pixels in the original image.

31
Image processing for BME 2_Lec 2_ 2020
Image processing for BME 2_Lec 2_ 2020 32
Nearest neighbor interpolation:
Nearest Used with rectangular heads
Neighbor

Bilinear interpolation:
Used for smoothing image
Bilinear

Bicubic interpolation:
Used for sharping the image
Bicubic

128 1024 64 1024


Image processing for BME 2_Lec 2_ 2020 33

You might also like