Digital Image Processing #HW2

Post on 04-Jan-2016

31 views 1 download

description

Digital Image Processing #HW2. RGB to YCbCr Conversion Background Subtraction & Denoising Using Morphological Operator. Contact Information Tzu- Jui Wang ( 王子睿 ) V isual C ommunications Lab Dep. of C ommunications E ngineering, N ational C entral U niversity - PowerPoint PPT Presentation

Transcript of Digital Image Processing #HW2

Digital Image Processing #HW2-RGB to YCbCr Conversion

-Background Subtraction & Denoising Using Morphological Operator

Contact Information

Tzu-Jui Wang (王子睿 ) Visual Communications Lab

Dep. of Communications Engineering,

National Central University No.300, Jhongda Rd., Jhongli City,

Taoyuan County 32001, Taiwan (R.O.C.) Phone: +886958801691

E-mail: juliuswang0728@gmail.com

Outline• Part #1 – RGB to YCbCr Conversion– Introduction to YCbCr

• Part #2 – Background Subtraction & Denoising using morphological operator

– Background Subtraction– Morphological operator

• Dilation & Erosion• Opening operator

• Grading Policy• Due Data & Demo Schedule

Introduction to YCbCr• Another color space.– Used in digital video and photography system.– Encode RGB information

• Y – luminance (強度 )• Cb – Chroma (彩度 ) of blue components• Cr – Chroma of red components

Introduction to YCbCr

RGB space

Y component

Cb component

Cr component

Introduction to YCbCr• Convert RGB to YCbCr

• Show the images representing Y, Cb, Cr, respectively.

128

128

0

1051506150

436028901470

114058702990

B

G

R

Cr

Cb

Y

...

...

...

Background Subtraction

• Visual “difference” always surprises machine ! (or human )

What I usually see…nothing’s new.

Oops..! Whose slipper ?

Background Subtraction• How to detect the unusual objects ?– Simplest method : background subtraction– Possible application : event detection / analysis.

- = ?

Y component of foreground Y component of background

Background Subtraction• Find the difference of two images in Y

component.• Produce binary images with proper threshold.

image new:

image background:

image foreground:

Z

Y

X

Noises are everywhere

!

0;

else

255;

) threshold ( if

Z(i,j)

Z(i,j)

(i,j)X(i,j) - Y

The output

What’s the Problem ?• Luminance components are always affected by

lights seriously !– But how about Cb and Cr components ?

Denoising Using Morphological Operator• Dilation (膨脹 )

(9.2-3)(9.2-4)

B : structure element

Denoising Using Morphological Operator• Erosion (侵蝕 )

(9.2-1)

(9.2-2)

B : structure element

Denoising Using Morphological Operator• Opening operator– Erode, and dilate.– Remove small object (noise), keep original shape.

After processing with opening

operator

Denoising Using Morphological Operator• Perfectly separate slipper and background.

Grading Policy• Part #1– Output images in Y, Cb, Cr component, respectively.

(2%)• Part #2– Output image after background subtraction and

thresholding (in binary form). (The noisy one) (2%)– Output two images, • After eroding. (1.5%)• After opening.(1.5%)

• Report (3%)

Download Test Samples• The test samples can be downloaded at– http://

140.115.156.251/vclab/html/course/DIP2010.html– .jpg files are provided, so you need to use MATLAB (or

others ?) to access the pixel information. (BUT DON’T implement this assignment in MATLAB)

Due Date & Demo Schedule• 11/17, Thursday, 19:00, R3-307 (@VCLab).• Send your report before 19:00, 11/17.– juliuswang0728@gmail.com– .pdf file is preferred.

Due Date & Demo Schedule• Your report could be much better.– There’re many details you can give in this assignments• Which component used for background subtraction

separates foreground and background better ? (or even fuse the subtraction results on multiple components ! You can try )• How do you setup your thresholds ?• How do you define your size of square structure element ?• What if change the shape of the structure element ?

– Fully discuss your wonderful design and the results.

Thanks, Good Luck !