Image Processing: Isotropic Gaussian filter

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
5/13/2010 9:46:04 AM
comp.soft-sys.matlab 207185 articles. 1 followers. lunamoonmoon (258) is leader. Post Follow

4 Replies
1765 Views

Similar Articles

[PageSpeed] 19
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
ImageAnalyst
5/13/2010 10:25:54 AM
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.
0
J
5/13/2010 10:47:49 AM
> 
> 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
Bruno
5/13/2010 11:14:07 AM
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
ImageAnalyst
5/13/2010 2:47:44 PM
Reply:
Similar Artilces:

gaussian smoothing of a 1-D vector
Hello, I need to smooth a 1-D vector. In the smoothing I need to have an option to choose the width of the smoothing function (number of cells). Does anyone know of a gaussian smoothing function? If not, do you know a matlab code I can use to solve this? Thank you. conv() can do it. Just convolve your array with your Gaussian window, of whatever length you want, and you're done. How exactly do you this? Sorry, but I have never done such smoothing before. Can you please give me an example code of how this can be done? Thank you. "fdfs tank" % Generate sample data. vector ...

RE: PEP 324: popen5
I've read the PEP, and I'd like to help with an implementation for Windows, if no-one else is doing it. Initially, I'll probably use win32all (or maybe ctypes) but the intention is that longer term the necessary functions be migrated into a supporting C extension. I do have some comments, which may be of interest. The whole interface feels very Unix-specific. In particular, 1. The preexec_* arguments have no meaning on Windows, where the low-level functionality is CreateProcess (spawn) rather than fork/exec. This isn't too crucial, as use of the argument can either ...

Printing text, image, text, image, ...
I have bunch of text files (about 20 lines) and bunch of image files. Is there a clean way to print text, then image, then text, then image, ...., as though there are in single continuous document? -- William Park <opengeometry@yahoo.ca>, Toronto, Canada ThinFlash: Linux thin-client on USB key (flash) drive http://home.eol.ca/~parkw/thinflash.html BashDiff: Super Bash shell http://freshmeat.net/projects/bashdiff/ ["Followup-To:" header set to comp.os.linux.misc.] On Fri, 23 Jun 2006 20:01:01 -0400, William Park staggered into the Black Sun and said: > I have [a] bu...

Menus with images
Hi, anyone knows how to put images on left side of the menu? I'm trying to create a menu like "MS word" with the images. Is there any type of object or aditional control ? Thank you all Guilherme Have a look at: http://www.xs4all.nl/~onkie/coolmenu.html ...

Cross Browser Bullet Image Positioning
When I use image as a bullet within LI element I have different image positioning results in Firefox and IE6. IE6 puts the image on top and far from left LI's border. Firefox puts it nicely in the middle and very close to left border. How do I control bullet image positioning? Please advise a nice hack. Thanks On 2008-04-30, vunet <vunet.us@gmail.com> wrote: > When I use image as a bullet within LI element I have different image > positioning results in Firefox and IE6. IE6 puts the image on top and > far from left LI's border. Firefox puts it nicely in the mid...

spectral image from elevation image image
Dear friends, I have an elevation satellite image that each pixel in this image has elevation value. For example, if we select one pixe (e.g. image(10,10)= 1300 m) which is the elevation value for this pixel location. I need to convert this elevation image into spectral image so that each pixel will have a spectral value (RGB value). I would apprecaite any comments or suggestions regarding this. Best regards Nadir ...

Display ENVI image
Dear IDL fans, Could any of you tell me how to display an ENVI image using IDL statements *ONLY*? I have pasted a sample header of one of my images and few pixel values below. Thanks, Kind regards, Ananth Kini _________________________________________________________________ Ananth Kini, Masters in Computer Science, Dept. of Computer Science Harvey R. Bright Bldg, TAMU, College Station, TX 77843 #4302, College Main, Apt 319, Bryan, TX 77801, Phone : 979-260-1954 kini@tamu.edu ~~~~~~~~~~~~~~~~~~~~~~~ Header for the image : ~~~~~~~~~~~~~~~~~~~~~~~ ENVI description = { Band Math Result, E...

Problem with an image control
This routine fails intermittently at line 6, when I try to set the Picture property of an Image object. It throws error 2001: You canceled the previous operation. 1. cFile = "D:\logos\" & frm.BrandCode & ".gif" 2. If Dir(cFile) = "" Then 3. frm.imageBrand.Visible = False 4. frm.lblNoImage.Visible = True 5. Else 6. frm.imageBrand.Picture = cFile 7. End If It happens only the first time I load up this form after starting Access. After that, it never happens, even with the same image .gif file. It happens if the code is in the ...

how to remove a noise in a color image by using vector median filter
hai I am trying to do a vector median filter and also finding PSNE,MAE and SSIM.. i found a formula for median filter and finding psnr.. bur i dont get for vector median filter, MAE and SSIM. if anyone know that, plse give steps or formula for that ...

median filter for qpsk signal
hi i have qpsk modulated signal and i want to filtr it through median filter . can any body tell me how can i do this ...

Re: Image restore fails #3
JF Mezei <jfmezei.spamnot@teksavvy.com> wrote on 08/19/2005 02:16:49 PM: > norm.raphael@metso.com wrote: > > I thought the primary idea of backward-compatibility would be most > > inviolate in a backup restore implementation. > > > It was a bug in backup. Hence the patch to fix the 6.x backup version. > BACKUP 7.2 has no problem with earlier version of image backups. > > So it isn't a sign of bad design. Just a sign of poor quality control in > the 6.x timeframe. Okay. And as was alluded to earlier in the thread, the Installation-CD version wo...

Filtering a RGB image
Hi all, I captured a video segment of a traffic sign, when travelling through a vehicle. Then I extract the RGB image frames using mmreader() function. This RGB image is bit blurred and noisy. I deblurred the image using "Lucy-Richardson Algorithm". But it is a very slow method. Are there any other fast mehods that I can use for this. Any references...Thanks. regards Prasanna Why does it need deblurring? A stop sign looks very different than a yield sign, etc. Can't you tell what kind of sign it it despite the blurring? Why spend time deblurring if you don't ne...

MT NewsWatcher filtering
I'd like to have any thread I have ever written in highlighted. I seem to remember this being easy when I used MT in the past, but now I can't figure it out. Any help? Maury In article <maury_markowitz-ECF1C3.08275713042005@nr-tor01.bellnexxia.net>, Maury Markowitz <maury_markowitz@hotmail.com> wrote: > I'd like to have any thread I have ever written in highlighted. I seem > to remember this being easy when I used MT in the past, but now I can't > figure it out. > > Any help? Hilite if "references" contains "maury_markowitz&...

Check Image is over another Image
Hello, is there a way to check if an image is over another image? in javascript hehe thanks :) ...

Importing images from scanner
hi I am working on a project which requires an image to be imported to matlab directly. Basically a have GUI. When i click on the pushbutton i want it to automatically read the image from the scanner ...

Debian
This is a continuation of the post "debian 3.0r2 smbfs fails and module not present." I lost that post for some reason so I have to start a new one. What I have: Installing 3.0r2 Woody as fresh install for testing on both a Duron 1K box and an old Pentium 233 box (now I'm focusing on the P233 box). I have performed fresh installs with both the bf2.4 kernel and the 2.2.20 kernel. Both of those install and work fine. At Andreas Janssen's recommendation I re-installed the bf2.4 kernel so dselect could see that it was installed. Then I decide I want to install the...

Images in GUI #2
I am making a GUI in which i want to display two images at the sides.I saw the video on Matlabcental about setting background images using imshow() in the CreateFn of the axes created and tried it out. The problem i am facing is that when i close Matlab and run the GUI again or run it on a different PC the axes 'tag' field becomes empty and the visibility is hence 'off'. Every time i have to rename the axes and go to the CreateFn of the axes. I am using R2007b. How can i solve this isssue? "Vaibhav Bedia" <vaibhav.bedia@gmail.com> wrote in message <fmhg3f...

creating an image out of multiple images
Hi all, I have some questions regarding image manipulation: - Is it possible add an alpha channel to an image via PHP? - Can I multiply an image with another image creating a new image? I want to create border with transparency around images uploaded to an photalbum. Regards Stijn You could definitely do so using imagemagik but i have no clue on how to do so since I have not really played with it too much. Mike > I have some questions regarding image manipulation: > - Is it possible add an alpha channel to an image via PHP? > - Can I multiply an image with another image creating...

<ask> problem with improve image contrast
i just try to see the image contras, i loaded the file and type >>figure, imhist(x) and error message comes as below ...can someone explain about it ? ??? Function IMHIST expected its first input, I or X, to be two-dimensional. Error in ==> imhist>parse_inputs at 216 iptcheckinput(a, {'double','uint8','logical','uint16','int16','single'}, ... Error in ==> imhist at 57 [a, n, isScaled, top, map] = parse_inputs(varargin{:}); ...

process handle to external application
Hi, I am opening an external program with System Exec.VI. I would like to create a process handle to that program to determine when it is finished, the program closes it self down after execution. Is that possible? Thanks in advance //Johan Hi, A much easier (an better) way is to let the System Exec.vi wait until it completes. If the program has to continue execution, start the VI dynamically, and check if the dynamic VI is done. I can't think of an easy way to get a process handle. It would be easier to get the new window handler (even if it's hidden there will probably be a windo...

Resolution of an image
Is there a way to get resolution of an image in matlab.(say the image was scanned 300dpi how to get this resolution value using matlab) thanks nlisha ...

Re: Font and Style problems using Image to create bitmaps of Plots/Charts etc #4
Alexey You are correct. If I change "Global Preferences", Formatting Options/Expression Formatting/Graphics Box Options/Graphics Box Options/BaseStyle these font options are picked up by Image. It would still be nice if that was fixed (I guess an issue is that if the kernel is running alone there is no style sheet) but this is a good interim measure. Thank you! Roger ...

Binary Image to Indexed Image to RGB Image
How will we convert binary image to indexed image? And then the indexed image to RGB image in Matlab? ...

mysql and images
Hello everyone, I have a couple questions and I am wondering if anyone could point me in the right direction. What I want to do, is the following... Upload an image (most likely jpeg), display it and store it in a mysql db right after upload, without storing a copy on the server and then referencing the file. Have another script that gets the image from the db and displays it once again without storing copies on the server. to upload its just <form enctype="multipart/form-data" action="uphome.php" method = "post"> <input type="hidden" na...

how do i check ads/images present on the web page
I need to check all the ads/images present on the webpage.They all are coming from different locations,need to verify ,all images are loading fine,no 404/302 error, also need to check the magic no is coming correctly for that image. you can use http://fanhouse.com as a input url. Thanks, Yogesh [Note: parts of this message were removed to make it a legal post.] Is this a quiz or a query? Get yourself hpricot, do some scraping using it on irb, and determine some basic heuristics/regexes for figuring out what css paths might refer to ads etc. Jayanth On Tue, Apr 28, 2009 at 8:05 AM, yog...