Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: how to take input image from user

Subject: how to take input image from user

From: Amol Deshpande

Date: 09 Apr, 2008 06:44:02

Message: 1 of 5

how to take input image from user through kerboard for
image processing? as we take value for any variabe say 'x'
from user through command scanf,similarly how to take
image in Matlab.

Subject: Re: how to take input image from user

From: Sven

Date: 09 Apr, 2008 07:33:02

Message: 2 of 5

"Amol Deshpande" <sdamol@rediffmail.com> wrote in message
<fthoji$t6n$1@fred.mathworks.com>...
> how to take input image from user through kerboard for
> image processing? as we take value for any variabe say 'x'
> from user through command scanf,similarly how to take
> image in Matlab.

What exactly do you mean by an image through a keyboard?

If you mean you ask the user to give matlab an image file
(.gif, .jpg, .bmp etc), then you can use the uigetfile
function to get a file name, and then use imread to load it
into matlab (although this isn't exactly getting the image
"from keyboard").

If you mean you want the user to somehow "type" the image
with the keyboard... then, other than asking them to type a
series of 1s or 0s, I'm a little lost.

Thanks,
Sven.

Subject: Re: how to take input image from user

From: Amol Deshpande

Date: 09 Apr, 2008 08:58:02

Message: 3 of 5

image through keyboard means, for example if we type 'c'
from keyboard then matlab should take 'cameraman.tif',if
we type 'f' then matlab should take 'football.jpg' etc;
and after taking the image the program should use the
image which we have provided to the program(like here we
have provided 'cameraman.tif').so what is the command or
function which will ask us 'which image you want to
process?' and then we can provide any image of our choice.

Subject: Re: how to take input image from user

From: Yumnam Kirani Singh

Date: 09 Apr, 2008 08:52:30

Message: 4 of 5

Won't an input box help?

Subject: Re: how to take input image from user

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 09 Apr, 2008 16:15:04

Message: 5 of 5

In article <fti0eq$brs$1@fred.mathworks.com>,
Amol Deshpande <sdamol@rediffmail.com> wrote:
>image through keyboard means, for example if we type 'c'
>from keyboard then matlab should take 'cameraman.tif',if
>we type 'f' then matlab should take 'football.jpg' etc;
>and after taking the image the program should use the
>image which we have provided to the program(like here we
>have provided 'cameraman.tif').so what is the command or
>function which will ask us 'which image you want to
>process?' and then we can provide any image of our choice.

If your program knows the names of the possible images in advance,
then consider using the menu() function, or the input() function
with the 'string' option.
--
   "Beware of bugs in the above code; I have only proved it correct,
   not tried it." -- Donald Knuth

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics