when should I pad image before filtering?

From: lucy (losemind_at_yahoo.com)
Date: 03/25/05


Date: Thu, 24 Mar 2005 22:26:57 -0800

I am always confused by the padding for image filtering.

I have an 270x230 "image" and is to be filtered with a 250x250 "filter".

I have made sure that the sum of all filter coefficients sum to be 1.

In Matlab,

sum(sum(filter)) =1.0000,

then I do image filtering:

result=imfilter(image, filter, 'same');

so the result is the also a 270x230 image... since I've used 'same' option,
...

I am not sure if the result is correct or not...

in fact, I even don't understand when a 270x230 image convolved with a
250x250 filter, is the result meaningful at all?

Anybody please give me some enlightment?

And Matlab has so many options: such as "replicate", "symmetric", etc:

        X Input array values outside the bounds of the array
                     are implicitly assumed to have the value X. When no
                     boundary option is specified, IMFILTER uses X = 0.

        'symmetric' Input array values outside the bounds of the array
                     are computed by mirror-reflecting the array across
                     the array border.

        'replicate' Input array values outside the bounds of the array
                     are assumed to equal the nearest array border
                     value.

        'circular' Input array values outside the bounds of the array
                     are computed by implicitly assuming the input array
                     is periodic.

When do we choose which option?



Relevant Pages

  • Re: some suggestions on my octave-band spectrogram analysis in fixed point DSP implementation
    ... i am aiming to design a 1/3 octave band spctrogram for vibration ... I use the digital 1/3 octave bandpass filter banks to achieve my goal. ... I did it in MATLAB. ... But after the implementation inside the fixed point dsp TMS320LF2407 ...
    (comp.dsp)
  • Re: matlab and dual core processing
    ... Yes, I need to compute a filter on a piece of data, and it's ... I'll have a look at both Star-P or Matlab DCT to see if they ... I'm not sure if running multiple instances of Matlab on a ...
    (comp.soft-sys.matlab)
  • Re: Filter design pls help
    ... I have relialized the filter using fdatool in matlab ... Can any one pls help me with the vhdl code ... "Applied Control Theory for Embedded Systems" by Tim Wescott ...
    (comp.dsp)
  • Re: Filter design pls help
    ... I have relialized the filter using fdatool in matlab ... Can any one pls help me with the vhdl code ... The working implementation our teacher has asked is on FPGAs ...
    (comp.dsp)
  • Re: help! how do I formulate this sampling system and analyze it?
    ... > then the integrating part is a continuous-time function who's transfer ... But what should be the integration convolution kernel(the filter)? ... All I know is that in the Matlab discrete time representation, ...
    (comp.dsp)