Re: when should I pad image before filtering?

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


Date: Thu, 24 Mar 2005 23:58:06 -0800


"lucy" <losemind@yahoo.com> wrote in message
news:d20avh$p2b$1@news.Stanford.EDU...
>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?
>
>
>

Strange. I really don't understand this:

what happens if I have a 270x230 image convolved with a
600x600 filter using Matlab function?

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

what happens if I have a 270x230 image convolved with a 100 x 100 filter
using the same matlab function?

Are these results still correct?

I understand the small case: if an image 270x230 convolved with a 3x3
filter, I understand, the image will have false values on its 4 side 1pixel
width boundary. All other values should be correct value...



Relevant Pages

  • Re: when should I pad image before filtering?
    ... >>I am always confused by the padding for image filtering. ... of the output image will be wrong. ... > 600x600 filter using Matlab function? ... The large filter case is no different (except ...
    (sci.image.processing)
  • when should I pad image before filtering?
    ... I am always confused by the padding for image filtering. ... I have made sure that the sum of all filter coefficients sum to be 1. ... In Matlab, ...
    (sci.image.processing)
  • Re: DWT anti-causality
    ... efficient way to downsize the filter. ... enables you to avoid downsampling won't decrease your delay. ... work around the problem by using such window lengths that no padding is ...
    (comp.dsp)
  • Spatial Filtering Help
    ... Hello I am looking for help with writing a Matlab function. ... dimensions and filter it with any filter of size A x B. ... I know for every location M x N of the original image I need ...
    (comp.soft-sys.matlab)
  • Re: analog bandpass filter
    ... using matlab to a filterto remove noise. ... anyone send me the coding for the filter? ... subject the signal to the filter in matlab.(the signal is sampled at ... You might like to check out the Matlab function 'fdatool' to help you ...
    (comp.dsp)