hello everyone, I am new to matlab, I need to
Create a program that allows user to choose an image of their choice and apply different types of spatial filters. program should display the input image and the result image. it should also allow the use to choose from alse 5 types of spatial filter.
I appreciated any answer from you guys,
thanks in advance

댓글 수: 3

Jafar
Jafar 2013년 11월 27일
TY for your reply, actually I want the whole program's code, meaning that I could easily run it on my PC, I have already search for it but I couldn't find any solution.TY
Walter Roberson
Walter Roberson 2013년 11월 27일
That sounds like an assignment / project.
You can look in the File Exchange, but I suspect you will not find exactly what you are looking for.
It is quite uncommon for the volunteers to write complicated programs for people (at least not for free.) Especially not programs that sound like assignments.
This resource, MATLAB Answers, is not designed for people to ask for people to ask other people to supply complete code. This resource is designed for asking questions about the MATLAB language, about the features, interpretation of the documentation, the names of routines that do common tasks, or about the meaning of error messages.
If you were to go ahead and write your program and were to encounter difficulties such as errors in it, then we could help you understand the errors.

댓글을 달려면 로그인하십시오.

 채택된 답변

Image Analyst
Image Analyst 2013년 11월 27일

1 개 추천

One suggestion. Use menu() and ask users if they want to run stdfilt(), entropyfilt(), medfilt2(), blurring with imfilter, and something else. Then use subplot(1,2,1) and subplot(1,2,2) to display the input and output images. Here is an example of how I used menu() to let the user pick what image they want to use.
% 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);

댓글 수: 3

ty for your answer, actually I wanted to accept the photo from the user, finally I search and watching tutorials and I come up with this code
% Read in a standard MATLAB gray scale demo image.
button = menu('Choose an Image to open', 'Browse File');
if button == 1
[FileName,PathName] = uigetfile('*.tif','Select the MATLAB code file');
A=imread(FileName);
colormap gray;
image(A);
end
% Get the full filename, with path prepended.
fullFileName = fullfile(folder, baseFileName);
This is my first program so sorry if I have done anything silly :D this is the first step of what I need to do, so now I can load the file but the problem is the file is not as same as the original file, the color is different a bit.
Image Analyst
Image Analyst 2013년 11월 28일
편집: Image Analyst 2013년 11월 28일
Try this code:
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = 'C:\Program Files\MATLAB';
if ~exist(startingFolder, 'dir')
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
usersImage = imread(fullFileName);
Jafar
Jafar 2013년 12월 11일
thanks, it was usefull and it heleped to solve my problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2013년 11월 27일

댓글:

2013년 12월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by