conv_downsample

conv_downsample(img, scale_factor, method, plot_on)

CONV_DOWNSAMPLE Downsample an image via convolution and decimation

Usage:

img_downsampled = conv_downsample(img, scale_factor, method, plot_on)

Inputs:

img : MxN double - image data – required scale_factor : 1x2 double - integer downsample ratio per dimension – required method : char or double - filter type: ‘mean’, ‘median’, ‘max’,

‘min’, or an order number (default: ‘mean’)

plot_on : logical - plot original vs downsampled (default: false)

Outputs:

img_downsampled : downsampled image

Example

img = peaks(200) + randn(200)/5; img_downsampled = conv_downsample(img, [4 6], ‘mean’);

See also: conv2, ordfilt2, imresize

∿∿∿ Prerau Laboratory MATLAB Codebase · sleepEEG.org ∿∿∿