Gaussian Low Pass

2 visualizaciones (últimos 30 días)
Mohammad Amirkhani
Mohammad Amirkhani el 28 de Ag. de 2011
Editada: Image Analyst el 11 de Dic. de 2013
In the name of GOD
Dear engineers Hi,
I'm working on a project : "Sea Current due Sea Surface Topography With altimetry data in PERSIAN GULF" for first, I should compute SST that SST = SSH-Geoid second, I should use a low pass filter ( EX. Gaussian Low Pass) for cut-off frequency.
Now, I have 3 questions about above.
1) Can you help me about aplication of Gaussian Low Pass filter in Geodesy?
2) can you help me about how can I work with this filter?
3) How can i compute cut-off frequency?
Best regard
  2 comentarios
Yang Jingling
Yang Jingling el 11 de Dic. de 2013
|monospaced|Hello,
Have you solved your problem? I want to use low-pass filter with a Gaussian filter for current data for cut-off frequency. But I don't know how to write the matlab codes. If you have solved could you send it me?
Beg your help!
Image Analyst
Image Analyst el 11 de Dic. de 2013
Editada: Image Analyst el 11 de Dic. de 2013
See my answer below. It's an actual demo, that perhaps Mohammad will officially "Accept". Of course you can also do it in the Fourier domain if you want, just fft, and then multiply by the Gaussian instead of convolve. Of course it must be the same size overall though the Gaussian within that matrix can have whatever width you want. Also, see Steve's series on Fourier transforms: http://blogs.mathworks.com/steve/category/fourier-transforms/
You can also try my demos, attached below in blue, if you want.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 11 de Dic. de 2013
See my demo:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures if you have the Image Processing Toolbox.
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
% Check that user has the Image Processing Toolbox installed.
hasIPT = license('test', 'image_toolbox');
if ~hasIPT
% User does not have the toolbox installed.
message = sprintf('Sorry, but you do not seem to have the Image Processing Toolbox.\nDo you want to try to continue anyway?');
reply = questdlg(message, 'Toolbox missing', 'Yes', 'No', 'Yes');
if strcmpi(reply, 'No')
% User said No, so exit.
return;
end
end
% Read in a standard MATLAB gray scale demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
button = menu('Use which demo image?', 'CameraMan', 'Moon', 'Eight', 'Coins', 'Pout');
if button == 1
baseFileName = 'cameraman.tif';
elseif button == 2
baseFileName = 'moon.tif';
elseif button == 3
baseFileName = 'eight.tif';
elseif button == 4
baseFileName = 'coins.png';
else
baseFileName = 'pout.tif';
end
% Read in a standard MATLAB gray scale demo image.
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
% Check if file exists.
if ~exist(fullFileName, 'file')
% File doesn't exist -- didn't find it there. Check the search path for it.
fullFileName = baseFileName; % No path this time.
if ~exist(fullFileName, 'file')
% Still didn't find it. Alert user.
errorMessage = sprintf('Error: %s does not exist in the search path folders.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
grayImage = imread(fullFileName);
% Get the dimensions of the image.
% numberOfColorBands should be = 1.
[rows, columns, numberOfColorBands] = size(grayImage);
if numberOfColorBands > 1
% It's not really gray scale like we expected - it's color.
% Convert it to gray scale by taking only the green channel.
grayImage = grayImage(:, :, 2); % Take green channel.
end
% Display the original gray scale image.
subplot(2, 2, 1);
imshow(grayImage, []);
axis on;
title('Original Grayscale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
% Create a blurring kernel.
kernel = fspecial('Gaussian', 32, 8);
subplot(2, 2, 2);
imshow(kernel, []);
axis on;
title('Blurring Kernel', 'FontSize', fontSize);
% Blur the image.
blurred = imfilter(grayImage, kernel, 'replicate');
subplot(2, 2, 3);
imshow(blurred);
axis on;
title('Blurred Image', 'FontSize', fontSize);

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by