COMPGROUPS.NET | Post | Groups | Users | Stream | Browse | About | |

### Image Processing: Isotropic Gaussian filter

• Email
• Follow

```Hi all,

I am using an isotropic Gaussian filter with standard deviation
sigmaX=3, sigmaY=3. Firstly, I would like to ensure that my matlab
code is correct in achieving this:

% Isotropic Gaussian filter with standard deviation sigmaX=3, sigmaY=3
filter = fspecial('gaussian', [3 3], 3);

If not, what is wrong with it, and how do I fix it?

Secondly, what is the relationship between standard deviation and
filter samples? The question I need to answer is as follows: "Given
this standard deviation how many filter samples are needed?" If
someone could point me in the right direction, that would be great.

Thanks.
```
 0
Reply trifinite84 (3) 5/13/2010 9:46:04 AM

See related articles to this posting

```Obviously there is no answer for this "Given this standard deviation
how many filter samples are needed?" for all images.  For example
given a SD of 15, you'll never achieve that in a uniform image no
matter how many samples you take.  Even for images WITH an SD of 15
you'll never achieve that.  So you're going to have to restate your
question.
```
 0

```On May 13, 12:25=A0pm, ImageAnalyst <imageanal...@mailinator.com> wrote:
> Obviously there is no answer for this "Given this standard deviation
> how many filter samples are needed?" for all images. =A0For example
> given a SD of 15, you'll never achieve that in a uniform image no
> matter how many samples you take. =A0Even for images WITH an SD of 15
> you'll never achieve that. =A0So you're going to have to restate your
> question.

I don't exactly follow. To make it clearer for me could you please
explain what a filter sample is and how it relates to standard
deviation?

The image is the standard "cameraman" image (512x512 grayscale), which
I am smoothing using a Gaussian filter with SDx=3D3,SDy=3D3. I don't know
if this changes the question.
```
 0

```>
> Secondly, what is the relationship between standard deviation and
> filter samples? The question I need to answer is as follows: "Given
> this standard deviation how many filter samples are needed?" If
> someone could point me in the right direction, that would be great.

I like to select the window size that is about 3*sigma in each side:
n = ceil(6*sigma+1)

And to enforce minimum of 3,

n = max(ceil(6*sigma+1), 3)

Bruno
```
 0

```On May 13, 6:47=A0am, J B <trifinit...@googlemail.com> wrote:
> On May 13, 12:25=A0pm, ImageAnalyst <imageanal...@mailinator.com> wrote:
>
> > Obviously there is no answer for this "Given this standard deviation
> > how many filter samples are needed?" for all images. =A0For example
> > given a SD of 15, you'll never achieve that in a uniform image no
> > matter how many samples you take. =A0Even for images WITH an SD of 15
> > you'll never achieve that. =A0So you're going to have to restate your
> > question.
>
> Thanks for the quick reply.
>
> I don't exactly follow. To make it clearer for me could you please
> explain what a filter sample is and how it relates to standard
> deviation?
>
> The image is the standard "cameraman" image (512x512 grayscale), which
> I am smoothing using a Gaussian filter with SDx=3D3,SDy=3D3. I don't know
> if this changes the question.

---------------------------------------------------------------------------=
---------------------------
Never mind - I got the standard deviations confused.  I thought you
were trying to get a certain specified SD in the image after you
filtered it, but you were actually talking about the width of the
Gaussian kernel.

Did you see the additional option in the help for fspecial??
"h =3D fspecial('gaussian', hsize, sigma) returns a rotationally
symmetric Gaussian lowpass filter of size hsize with standard
deviation sigma (positive). hsize can be a vector specifying the
number of rows and columns in h, or it can be a scalar, in which case
h is a square matrix. The default value for hsize is [3 3]; the
default value for sigma is 0.5."

hsize is basically the window width of the kernel you're going to scan
with, for example 21 pixels by 21 pixels, or 100 by 100.  sigma is the
width of the Gaussian shape that falls inside that window, for example
3 pixels.  Understand now?  Obviously you don't need the window width
to be much wider than about 6 or 7 sigmas because the Guassian will
flatten out by the time it gets to the edge.
```
 0
 comp.soft-sys.matlab 203357 articles. 529 followers.

4 Replies
1515 Views

Similar Articles

[PageSpeed] 50

• Email
• Follow

Similar Artilces:

Image smoothing using an isotropic Gaussian filter
I want to smooth an image using an isotropic Gaussian filter with standard deviation of =F3x, =F3y =3D 3. To achieve this, can I use the fspecial function to create the smoothing filter as follows: gauss_filter =3D fspecial('gaussian', [x y], 3); With [x y] being the size of the filter to apply to the image. If not, what should I be using instead? Also, what is the relationship between the number of filter samples required and the standard deviation used? Thanks. ...

what is the cutoff frequency for Gaussian filter in Matlab imaging processing?
Hi all, This is a continuum of the question I post one moment ago. I've obtained a 11x11 impulse response for that 2D low pass Butterworth filter of 7th order and 0.2 cutoff frequency(normalized frequency range [-0.5, 0.5])... My friend claimed that the following 11x11 h impulse response have negative values in it so it is no good for image filtering... (btw, why are there negative values? ) He suggests that I forget these fancy filters and use a plain Gaussian filter for low pass filtering... however I looked into the "fspecial" command in Matlab image toolbox... and I ...

padding gaussian matrix for 2d filtering image process
I must do a Gaussian Filter on image, I have matrix data image in a 100x100 matrix. I generate a 7x7 gaussian matrix for filtering, how do I padding the gaussian matrix for obtain a 100x100 matrix ? with zeros value around gaussian value ? thank you so much. anyone can help me ? ...

Filters : a library implementing image filters and image processing functions
Dear members, I would like to inform you that we have released our last version of the open source library "Filters". We will appreciate your feedback. link : http://filters.sourceforge.net/ Regards In short, no source code = crap. Come back when you've got something real to download, a few demos and some API's don't equate to much these days... edurand wrote: > Dear members, > I would like to inform you that we have released our last version of > the open source library "Filters". We will appreciate your feedback. > link : http://filters.so...

(image process) are there any guidelines on how to design good filters to enhance an image?
dear all, I am facing the following problem that I need your help: We have in our experiments some special images need to be processed. My task is to look at these images and see how to improve/enhance them. In fact we/I have no idea on how much enhancement we can get. So what I've done in the past month is to play with different kind of filters to try on the images. We use PSNR as judgement. It turns out I found a Gaussian 3x3 filter has particularly high enhancement to the images, comparing with other filters provided by Matlab, such as "laplacian", "averaging"... ...

image processing and filtering
Hi, My program is to read some images and then high pass filter to filter the image and plot out the rms values. I&#8217;m able to read and display the image. But the filter got problem. The error message: ??? Undefined function or variable 'filterarray'. Error in ==> D:\MATLAB6p5p1 \work\signalimage\FocusImages\new.m On line 47 ==> lengthoffilter=length(filterarray); I can&#8217;t continue. Anybody know how to troubleshoot? Below is the program. Thank you. Regards, Sem -------------------------------------------------- clc; close all; clear all; for picture=1:...

Applying a gaussian filter to an image
Hi, I am quite new to Matlab. Is there a built-in function to apply a gaussian filter over a color image? If not, any hints on how to do it? Also, if there is a built-in function, can I tell it to handle edges differently (like, using kernel renormalization?) Thanks a lot in advance. Did you try this? filterMask = gausswin(dy) * gausswin(dx)'; imageOut = filter2(filterMask, imageIn); Where dx and dy is the size of the rectangular filter mask. I would do the edge handling manually by padding, but maybe there is a better way to do that. Regards Markus [url=http://zvxcxw.googlepages...

image processing
Hi, If I am using scipy.ndimage.gaussian_filter() for filtering an image, how to do the inverse filtering? In general how to do this using scipy.ndimage? Thanks suresh In article <5bfefbb6-89a8-49f6-9f02-7d36dfbc0f16@c29g2000yqd.googlegroups.com>, suresh.amritapuri <suresh.amritapuri@gmail.com> wrote: > >If I am using scipy.ndimage.gaussian_filter() for filtering an image, >how to do the inverse filtering? In general how to do this using >scipy.ndimage? http://projects.scipy.org/mailman/listinfo/scipy-user -- Aahz (aahz@pythoncraft.com) &...

Gabor filters in Image Processing
i have to filter my images by Gabor filters. I write my Gabor function. It takes the parameters of "Size", "Standard Deviation", "Period" and the "Orientation of gabor shell". My purpose is to find rectangles in the images. After filtering, i will binarize my images, and i will approximately find the places of rectangles in my images. That seems ok. but every images have different backgrounds and illumination level. Although i have done preprocessing, the output of filtering is not good. I have chose the parameters of filters by trial and err...

IMAGE PROCESSING
Hi, I have an RGB image and without converting it to grayscale I want to do median filtering. Is it possible , if so how ? I tried to create the median filter but it give me following error Function ORDFILT2 expected its first input, A, to be two-dimensional. Error in ==> ordfilt2>ParseInputs at 135 iptcheckinput(A, {'numeric','logical'}, {'2d','real'}, mfilename, 'A', 1); Error in ==> ordfilt2 at 51 [A,order,domain,s,padopt,msg] = ParseInputs(varargin{:}); Error in ==> medfilt2 at 57 b = ordfilt2(a, order1, domain, padopt); Erro...

matched filtering (image processing)
Hi, Have anyone done any image processing function called matched filtering. I have two input images (same size). The output should be the correlation value between two image. I tried corr2 function but it doesn't work well when the image is shifted to left or right (not shifting invariant). I hope that matched filtering will solve this problem. thanks xcorr2 or conv2 should do the job, if you design your matched filter accordingly. /Johan yo wrote: > Hi, > Have anyone done any image processing function called matched > filtering. I have two input images (same size). T...

image processing Gaussian smoothing
why Gaussian smoothing is commonly used with edge detection? what is the most suitable smoothing method for __edge detection algorithm? Is it Gaussian smoothing? If so, why? ...

sinc filter for image processing
Hi, I want to use sinc filter for image processing. As I understand for its theory this can be suitable for edge detection operation.How can I do this in Matlab? Could you help me about this operation? Thanks. On Sep 22, 4:28=A0am, "elysion87 " <saki...@gmail.com> wrote: > Hi, > > I want to use sinc filter for image processing. As I understand for its t= heory this can be suitable for edge detection operation.How can I do this i= n Matlab? Could you help me about this operation? > Thanks. ----------------------------------------------------------- Yes. Set u...

Image processing: high pass filter
Hey guys. I kinda need some help here. I'm doing some image processing and I'm programming some filters. Here's the case of a high pass filter, for instance with a 5x5 kernel which has this form (I stole it from the IPP): 0 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 21 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 0 So, the negative coefficients here may turn the result of applying the kernel to be negative for a particualr pixel, or maybe bigger than 255. Is there any normalization technique? I tried uint8 but the results are far worse than what I get when applying the filter in IPP Than...

CVS for image processing and adaptive filter
Hi my name is Alam, and now i'm working for my final project in my university. My task is to set up a vision based tracking system. It use a single firewire camera to detect the presence of an object using some image processing algorithm that give an information about object coordinate position. I use this information as the input for Kalman Filter so that i can predict the object position for the next state of my system. I just want to know if I can do that job using LabView and CVS 1454 ( because my supervisor order me to use it ). If it is possible I also want to know how can i send ...

matlab image processing matched filter
hi to all Im new to image processing and also to matlab. I have a project which needs to extract blood vessels from retinal image by using matched filtering and It looks like I have to desgin one but I have no idea what is a matched filter. Can some please explain me image processing with matched filtering thank you ANIL Why do you need to use a matched filter? Why not use any method that you can think of that will work? If it's your homework problem, then review your notes from the class lectures or ask your professor. If you have a MATLAB question, such as how to use im...

processing and filtering image spot satelital
i can any process with matlab to image spot5 satellite. You have any practice with this? tank regards ...

the point of passing through a filter in image processing
Hi, I have a basic question on image processing, after FT, I got the casted image on different colors, or different freq. Next is to pass through a filter to get the freq that I want. I am wondering, I can just pick up any freq I want, and the band of freq I want. Why do I have to construct a filter? Is it really needed? Or how a filter is being used in image processing? thanks PZ PZ wrote: > Hi, > > I have a basic question on image processing, after FT, I got the casted > image on different colors, or different freq. Next is to pass through a > filter to get the freq tha...

Image processing threshold and median filter
Hi, i am new to matlab. I am currently processing sets of data, which the data is in 520x688 pixels. Now, for example in the matrix 520x688, there are some values that more than the threshold value, say my threshold value is 3000, and say we take only 7x4 array like below 2330 2689 2072 2864 2763 2865 2695 2450 4210 2550 2543 2560 2654 2986 2564 2564 2564 2564 3514 2014 2045 2465 2555 2987 2106 2541 2644 2304 so, in that matrix, i have got 2 values that is more than 3000, which are 4210 and 3514. So what i wanted to do is the matlab to find the value that is more than 3000, an...

Using an image mask as a filter for video processing
I am trying to measure the change in area of an object for a neurophysiology assay. Currently, I load a video, crop it, apply a rgb filter to the frames of interest and pass that information onto bwlabel. I use bwlabel and regionprops to calculate the change in area for each frame, saving the data as a vector providing me with a nice curve. My problem is this: i want to calculate the area of an individual object, while excluding other objects in frame within the parameters of rgb filter . The rgb filter works okay but it can be too lax or stringent depending on the circumstances. I want ...

image processing face tracking for particle filter
somebody ever used particle filter(PF)? i write face detection code and particle filter code the particle filter used random number made initial value simulated how can i make face detection and PF combine ? ...

image processing: FFT and low pass filtering
As a beginner of image processing, it is asked from me to write C codes that take FFT(Fast fourier transform) of a 256X256 image then passing the image from a low pass filter and at the end taking inverse transform to obtain the original filtered image. i thought that Matlab can help me on this way: if i write the m code of the programme and then using the Matlab compiler convert that to C code. But i am having difficulties to obtain H(u,v): low pass filter in fruquency domain. Could somebody help me?I will appreciate. Thanks Eyup wrote: > > > As a beginner of image process...

Region of Interest Filtering in Image Processing Toolbox
I am trying to conduct a bwlabel and then a subsequent regionprops(centroid) to extract the centroid of a blob. However, I need to limit where bwlabel searches for these objects. I am having a very difficult time simply masking the image so the bwlabel only searches where a poly region that I specify, any help would be greatly appreciated!!! Wally Davinport wrote: > > > I am trying to conduct a bwlabel and then a subsequent > regionprops(centroid) to extract the centroid of a blob. However, I > need to limit where bwlabel searches for these objects. I am having > a > very...

Server-side image processing using Photoshop filters
Hi, Does anyone know of a good way to do server-side image processing, and take advantage of Photoshop's filters (e.g. drop shadow, inner glow, etc.). Basically we need the image quality of Photoshop, but all the images are processed in a multi-threaded non-GUI service. I know Photoshop does expose an automation interface, but that would require PS to be installed on the server, and moreover it is not suitable for high-performance use (due to the fact that it needs a GUI and is a single-use COM server). Any suggestions would be appreciated. Thanks. "r4d0n" <mqtest@hotma...