100 likes | 289 Views
Lecture 07 Roger S. Gaborski. Introduction to Computer Vision. QUIZ 2. Simple 1 D Averaging Example. 3 point moving average 5 point moving average. Simple 1 D Averaging Example. 3 point moving average 5 point moving average NEED FOR PADDING. Padding an array -- padarray.
E N D
Lecture 07 Roger S. Gaborski Introduction to Computer Vision Roger S. Gaborski
Simple 1 D Averaging Example • 3 point moving average • 5 point moving average
Simple 1 D Averaging Example • 3 point moving average • 5 point moving average • NEED FOR PADDING
Padding an array -- padarray • fp = padarray(f, [r c], method, direction) • f is input image • fp is padded image • [r c] is number of rows and columns to pad f • method and direction – next slide Roger S. Gaborski
Chapter 3 www.prenhall.com/gonzalezwoodseddins Roger S. Gaborski
padarray Example >> f = [1 2; 3 4] f = 1 2 3 4 >> fp = padarray(f, [3 2], 'replicate', 'post') fp = 1 2 2 2 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 Post – pad after the last element in both directions [3 2] – pad 3 rows and 2 columns Roger S. Gaborski
>> fp = padarray(f, [2 1], 'replicate', 'post') fp = 1 2 2 3 4 4 3 4 4 3 4 4 Post – pad after the last element in both directions [2 1] – pad 2 rows and 1 columns Roger S. Gaborski
>> f = [1 2 3; 1 2 3; 1 2 3] f = 1 2 3 1 2 3 1 2 3 >> fp = padarray(f, [2 2], 'symmetric', 'both') fp = ?????? Roger S. Gaborski
>> f = [1 2 3; 1 2 3; 1 2 3] f = 1 2 3 1 2 3 1 2 3 >> fp = padarray(f, [2 2], 'symmetric', 'both') fp = 2 1 1 2 3 3 2 2 1 1 2 3 3 2 2 1 1 2 3 3 2 2 1 1 2 3 3 2 2 1 1 2 3 3 2 2 1 1 2 3 3 2 2 1 1 2 3 3 2 Roger S. Gaborski