Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news2.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe02.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Image Classification
References: <glbp56$g5s$1@fred.mathworks.com>
In-Reply-To: <glbp56$g5s$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 30
Message-ID: <WVlel.112824$4M4.65154@newsfe02.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe02.iad 1232726774 24.79.146.116 (Fri, 23 Jan 2009 16:06:14 UTC)
NNTP-Posting-Date: Fri, 23 Jan 2009 16:06:14 UTC
Date: Fri, 23 Jan 2009 10:06:30 -0600
Xref: news.mathworks.com comp.soft-sys.matlab:513435


Manju wrote:
> I want to reduce the size of color image.i want to fix the size (45*47) of color image..
> plz help me out.

If you have the image processing toolbox, then imresize()

There are numerous methods of resizing images, and the proper one for your
application will depend upon which properties you wish to preserve.
For example in some applications it is important to preserve edges
when the image is resized, but many of the simpler methods of image
resizing tend to blur edges.

If you have not been given any criteria as to what is important to preserve
or not, then to do the resizing, use this code:

imsize = size(TheImage);
sx = imsize(1); sy = imsize(2);
if sx < 45 || sy < 47
  error('image is too small to resize to 45 x 47');
end
rx = ceil((sx - 45) * rand);
ry = ceil((sy - 47) * rand);
NewImage = TheImage(rx:rx+44, ry:ry+46,:);


-- 
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?